berryccc1/EVM-QuestBench huggingface dataset:
DelegateCall - Proxy Pattern
Category: advanced_features / delegate_call
Difficulty: hard
Chain: BSC (mainnet)

Call a function through a proxy contract that uses delegatecall to execute logic from an implementation contract.

Technical context:
- The proxy contract forwards calls to an implementation contract using delegatecall
- DelegateCall executes the implementation's code in the proxy's context
- Storage changes affect the proxy contract, not the implementation
- msg.sender remains the original caller
- Function signature: setValue(uint256 value)
- Function selector: 0x55241077 (keccak256('setValue(uint256)') first 4 bytes)
- Recommended gas limit: 100000

Key considerations:
- You call the PROXY contract, not the implementation contract
- The proxy forwards your call using delegatecall
- Use encode the function call('setValue', [value]) to encode
- Set transaction 'to' to the PROXY address
- Set transaction 'value' to 0 (not sending BNB)
- The value will be stored in the proxy's storage

DelegateCall explained:
- Regular call: Implementation contract modifies its own storage
- DelegateCall: Implementation's code runs, but modifies caller's (proxy's) storage
- This is the foundation of upgradeable contracts

Success criteria:
- Transaction executes successfully
- Correct proxy contract is called
- Correct function selector is used
- Value is stored in the PROXY contract (not implementation)
- Implementation contract's storage remains unchanged

Example requests:
Call the setValue function on the proxy contract at {proxy_address} with value {value}
Set the value to {value} using the proxy contract {proxy_address}
Execute setValue({value}) through the proxy at {proxy_address}
I want to call setValue on proxy {proxy_address} and pass {value}
Payable Fallback - Send BNB to Contract
Category: advanced_features / fallback
Difficulty: medium
Chain: BSC (mainnet)

Send BNB directly to a contract without calling any specific function.
This will trigger the contract's receive() or fallback() function.

Technical context:
- When you send BNB to a contract without calldata, it triggers receive() if it exists
- If receive() doesn't exist, it triggers fallback() if it's payable
- The transaction 'to' field is the contract address
- The 'value' field contains the BNB amount to send
- The 'data' field should be empty (0x) or omitted
- Recommended gas limit: 100000

Fallback vs Receive:
- receive() external payable: Called when BNB is sent with empty calldata
- fallback() external payable: Called when function doesn't exist or as fallback for receive()
- At least one must be payable for the contract to receive BNB

Key considerations:
- Do NOT include any function call data
- Set transaction 'value' to the BNB amount (in wei)
- Leave 'data' field empty or set to '0x'
- The contract must have a payable receive() or fallback() function

Success criteria:
- Transaction executes successfully
- Correct contract address is used
- Correct BNB amount is sent
- No function call data (empty data field)
- Contract balance increases by the sent amount

Example requests:
Send {amount} BNB to the contract at {contract_address}
Transfer {amount} BNB to contract {contract_address} without calling any function
I want to send {amount} BNB directly to {contract_address}
Send {amount} BNB to {contract_address} (no function call)
ERC20 FlashLoan - Execute Flash Loan
Category: advanced_features / flashloan
Difficulty: hard
Chain: BSC (mainnet)

Execute a flash loan by calling the FlashLoan contract's executeFlashLoan function.

Technical context:
- Flash loan allows borrowing tokens without collateral in a single transaction
- The loan must be repaid with a fee (0.3%) in the same transaction
- Function signature: executeFlashLoan(address token, uint256 amount)
- Before calling, you must approve the flash loan contract to pull back tokens
- The approval amount should be: loan amount + fee
- After the flash loan call, the contract will transfer tokens to you, then pull them back with fee
- If repayment fails, the entire transaction reverts
- Recommended gas limit: 300000

Transaction flow:
1. Calculate repayment amount: amount + (amount * 0.003)
2. Approve flash loan contract for repayment amount
3. Call executeFlashLoan(token_address, amount)
4. Contract transfers tokens to you (loan)
5. Contract immediately pulls back loan + fee

Key considerations:
- You must have enough tokens to pay the fee
- The flash loan contract must have sufficient liquidity
- Set 'to' to the flash loan contract address
- Set 'value' to 0 (not sending BNB)
- The transaction data should contain the encoded executeFlashLoan call
- Use EIP-1559 transaction type (type: 2)

Example requests:
Execute a flash loan of {amount} {token_symbol} from the flash loan contract at {flashloan_contract_address}. The loan must be repaid with {fee_percentage}% fee in the same transaction.
Borrow {amount} {token_symbol} using flash loan from contract {flashloan_contract_address}, use the funds, and repay with fee.
Take a flash loan of {amount} {token_symbol} tokens from {flashloan_contract_address}. Remember to approve the contract to pull back the loan amount plus {fee_percentage}% fee.
I need to execute a flash loan: borrow {amount} {token_symbol} from {flashloan_contract_address} and repay it with the {fee_percentage}% fee in one transaction
Query Current Block Number
Category: basic_transactions / blockchain_queries
Difficulty: easy
Chain: BSC (mainnet)

Query the current block height of the blockchain by calling eth_blockNumber RPC method. This is a fundamental blockchain query that returns the latest block number, useful for tracking blockchain state, calculating block intervals, and determining transaction timing. The block number increases with each new block mined.

Example requests:
Get the current block number of the blockchain
Query the latest block height
Check what is the current block number
Retrieve the most recent block number from the chain
Query Gas Price
Category: basic_transactions / blockchain_queries
Difficulty: easy
Chain: BSC (mainnet)

Query the current gas price and EIP-1559 fee parameters by calling eth_gasPrice or getFeeData() methods. This returns the current network gas pricing information including maxFeePerGas and maxPriorityFeePerGas for EIP-1559 transactions. Understanding gas prices is crucial for estimating transaction costs and optimizing transaction submission timing.

Example requests:
Get the current gas price of the network
Query the current EIP-1559 fee parameters
Check what is the current maxFeePerGas and maxPriorityFeePerGas
Retrieve the current gas pricing information
Query Transaction Count (Nonce)
Category: basic_transactions / blockchain_queries
Difficulty: easy
Chain: BSC (mainnet)

Query the transaction count (nonce) for a specific address by calling eth_getTransactionCount. The nonce represents the number of transactions sent from an address and is critical for transaction ordering and replay protection. Understanding the difference between 'pending' and 'latest' states is important: 'pending' includes pending transactions and should be used when preparing new transactions, while 'latest' only includes confirmed transactions.

Example requests:
Get the transaction count (nonce) for address {{query_address}}
Query the nonce for address {{query_address}}
Check how many transactions address {{query_address}} has sent
Retrieve the current nonce for address {{query_address}}
Simple Contract Call - Increment Counter
Category: basic_transactions / contract_call
Difficulty: medium
Chain: BSC (mainnet)

Call a simple contract function without parameters.

Technical context:
- The target contract is a SimpleCounter with an increment() function
- Function signature: increment() (no parameters, no return value)
- This is a state-changing function that increases a counter by 1
- Function selector: 0xd09de08a (keccak256('increment()') first 4 bytes)
- Recommended gas limit: 50000

Key considerations:
- Create a Contract instance with the contract address and ABI
- Use encode the function call('increment', []) to encode the call
- Set transaction 'to' to the contract address
- Set transaction 'data' to the encoded function call
- Set transaction 'value' to 0 (not sending BNB)
- The contract will emit a CounterIncremented event with the new value

Success criteria:
- Transaction executes successfully
- Correct contract is called
- Correct function selector is used
- Counter value increases by 1

Example requests:
Call the increment() function on the contract at {contract_address}
Increment the counter in the smart contract {contract_address}
Execute the increment function on contract {contract_address}
I need you to call increment() on the contract at address {contract_address}
Contract Call with Parameters - Set Message
Category: basic_transactions / contract_call
Difficulty: medium
Chain: BSC (mainnet)

Call a contract function with parameters (string argument).

Technical context:
- The target contract is a MessageBoard with a setMessage(string) function
- Function signature: setMessage(string message)
- This function accepts a string parameter and stores it
- You must encode both the function selector and the parameter data
- Function selector: 0x368b8772 (keccak256('setMessage(string)') first 4 bytes)
- Recommended gas limit: 80000 (storage write + dynamic data)

Key considerations:
- Create a Contract instance with the contract address and ABI
- Use encode the function call('setMessage', [message]) to encode the call
- Set transaction 'to' to the contract address
- Set transaction 'data' to the encoded function call (selector + encoded parameters)
- Set transaction 'value' to 0 (not sending BNB)
- String parameters are dynamically sized and require ABI encoding

Success criteria:
- Transaction executes successfully
- Correct contract is called
- Correct function selector is used
- Message is correctly stored in the contract

Example requests:
Call the setMessage function on contract {contract_address} with the message '{message}'
Set the message to '{message}' on the contract at {contract_address}
Update the message in contract {contract_address} to '{message}'
I want to call setMessage on contract {contract_address} and pass the string '{message}'
Contract Call with Value - Send BNB to Payable Function
Category: basic_transactions / contract_call
Difficulty: medium
Chain: BSC (mainnet)

Call a payable contract function with BNB value attached.

Technical context:
- The target contract is a DonationBox with a payable donate() function
- Function signature: donate() payable
- This function accepts BNB and records donations
- You must set the transaction 'value' field to send BNB
- Function selector: 0xed88c68e (keccak256('donate()') first 4 bytes)
- Recommended gas limit: 100000 (storage writes and event emission)

Key considerations:
- Create a Contract instance with the contract address and ABI
- Use encode the function call('donate', []) to encode the call
- Set transaction 'to' to the contract address
- Set transaction 'data' to the encoded function call
- Set transaction 'value' to the BNB amount to send (in wei)
- The contract's BNB balance will increase by the donation amount

Success criteria:
- Transaction executes successfully
- Correct contract is called
- Correct function selector is used
- Correct amount of BNB is sent
- Contract balance increases by the donation amount

Example requests:
Call the donate() function on contract {contract_address} and send {amount} BNB
Donate {amount} BNB to the contract at {contract_address}
Send {amount} BNB to the donate function of contract {contract_address}
I want to call donate() on contract {contract_address} with {amount} BNB attached
ERC20 Token Approval
Category: basic_transactions / erc20_operations
Difficulty: easy
Chain: BSC (mainnet)

Approve a spender (Router or Contract) to spend your ERC20 tokens. This is a prerequisite for many DeFi operations like swapping or adding liquidity.

The approve function sets the allowance that a spender can use on behalf of the token owner.

Key Points:
- Function: approve(address spender, uint256 amount)
- Sets allowance for spender to transfer tokens on your behalf
- Does not transfer tokens, only grants permission
- Required before operations like swap, transferFrom, addLiquidity, etc.
- Common spenders: PancakeSwap Router, Staking Contracts, etc.

Transaction Requirements:
- Call approve() on the ERC20 token contract
- Pass spender address and amount to approve
- Wait for transaction confirmation
- No BNB value needed (not payable)
- Gas: ~50,000

Example Workflow:
1. Connect to ERC20 token contract
2. Call approve(spenderAddress, amountInWei)
3. Wait for confirmation
4. Verify allowance was set correctly

Example requests:
Approve {spender_name} to spend {amount} {token_symbol} tokens from your account.
Grant approval to {spender_name} for {amount} {token_symbol} tokens.
Set allowance of {amount} {token_symbol} tokens for {spender_name}.
Authorize {spender_name} to use up to {amount} {token_symbol} tokens on your behalf.
ERC20 Approve with Callback (ERC1363)
Category: basic_transactions / erc20_operations
Difficulty: medium
Chain: BSC (mainnet)

Approve an address to spend ERC20 tokens and trigger an `onApprovalReceived` callback on the spender contract if it implements `IERC1363Spender`.

Technical context:
- ERC1363 extends ERC20 with payable token functions
- Function signature: approveAndCall(address spender, uint256 value) or approveAndCall(address spender, uint256 value, bytes data)
- The spender must implement IERC1363Spender interface to receive callback
- If spender is a contract implementing IERC1363Spender, onApprovalReceived will be called
- If spender doesn't implement the interface, it works like regular approve
- Recommended gas limit: 200000

Key considerations:
- Use the deployed ERC1363 test token (T1363)
- Create a Contract instance with token address and ERC1363 ABI
- The approveAndCall function combines approve and callback in one transaction
- Set transaction 'to' to the token contract address
- Set transaction 'value' to 0 (not sending BNB)
- After approval, allowance(owner, spender) should return the approved amount

Example requests:
Approve {spender_address} to spend {amount} {token_symbol} tokens with callback
Use ERC1363 approveAndCall to authorize {spender_address} to use {amount} {token_symbol}
Grant approval to {spender_address} for {amount} {token_symbol} using the ERC1363 token's callback feature
Approve {amount} {token_symbol} for {spender_address} with automatic onApprovalReceived callback
ERC20 Token Burn
Category: basic_transactions / erc20_operations
Difficulty: medium
Chain: BSC (mainnet)

Burn (destroy) ERC20 tokens by transferring them to the zero address (0x0000...0000), permanently removing them from circulation.

Technical context:
- Most ERC20 tokens don't have a dedicated burn() function
- The standard way to burn tokens is to transfer them to address(0)
- Zero address: 0x0000000000000000000000000000000000000000
- Once sent to zero address, tokens are permanently lost
- Function signature: transfer(address to, uint256 amount)
- Recommended gas limit: 70000

Key considerations:
- Create a Contract instance with token address and standard ERC20 ABI
- Use encode the function call('transfer', [zeroAddress, amount])
- Set transaction 'to' to the token contract address
- Set transaction 'value' to 0 (not sending BNB)
- The 'to' parameter in transfer should be the zero address
- After burning, your token balance decreases
- Burned tokens are sent to 0x0000000000000000000000000000000000000000

Example requests:
Burn {amount} {token_symbol} tokens
Destroy {amount} {token_symbol} tokens permanently by sending to zero address
Remove {amount} {token_symbol} from circulation using the test token
Burn {amount} {token_symbol} from the ERC1363 test token
ERC20 Decrease Allowance
Category: basic_transactions / erc20_operations
Difficulty: easy-medium
Chain: BSC (mainnet)

Decrease the allowance for a spender (Router or Contract) by a specified amount. This safely reduces an existing allowance without completely revoking it.

The decreaseAllowance function subtracts from the existing allowance and includes underflow protection.

Key Points:
- Function: decreaseAllowance(address spender, uint256 subtractedValue)
- Subtracts subtractedValue from the current allowance
- Safer than calling approve(spender, 0) to revoke
- Includes built-in underflow protection
- Will revert if subtractedValue > current allowance

Technical Details:
- Function selector: 0xa457c2d7
- New allowance = current allowance - subtractedValue
- Requires: subtractedValue <= current allowance
- Automatically prevents underflow (Solidity 0.8+)
- Transaction will FAIL if trying to subtract more than current allowance

Transaction Requirements:
- Call decreaseAllowance() on the ERC20 token contract
- Pass spender address and amount to subtract
- Ensure subtractedValue <= current allowance
- Wait for transaction confirmation
- No BNB value needed (not payable)
- Gas: ~50,000

Example Workflow:
1. Query current allowance (important!)
2. Ensure subtractedValue <= current allowance
3. Call decreaseAllowance(spenderAddress, subtractedValueInWei)
4. Wait for confirmation
5. Verify allowance decreased by subtractedValue

Example requests:
Decrease the allowance for {spender_name} by {subtracted_value} {token_symbol} tokens.
Reduce {spender_name}'s allowance by {subtracted_value} {token_symbol}.
Subtract {subtracted_value} {token_symbol} from the allowance for {spender_name}.
Lower the spending limit for {spender_name} by {subtracted_value} {token_symbol}.
ERC20 Increase Allowance
Category: basic_transactions / erc20_operations
Difficulty: easy
Chain: BSC (mainnet)

Increase the allowance for a spender (Router or Contract) by a specified amount. This is safer than calling approve() directly as it prevents race conditions.

The increaseAllowance function adds to the existing allowance instead of overwriting it.

Key Points:
- Function: increaseAllowance(address spender, uint256 addedValue)
- Adds addedValue to the current allowance
- Safer than approve() for incremental changes
- Prevents front-running race conditions
- Common use case: topping up an existing allowance

Technical Details:
- Function selector: 0x39509351
- New allowance = current allowance + addedValue
- No risk of underflow (only addition)
- Automatically prevents overflow (Solidity 0.8+)

Transaction Requirements:
- Call increaseAllowance() on the ERC20 token contract
- Pass spender address and amount to add
- Wait for transaction confirmation
- No BNB value needed (not payable)
- Gas: ~50,000

Example Workflow:
1. Query current allowance (optional)
2. Call increaseAllowance(spenderAddress, addedValueInWei)
3. Wait for confirmation
4. Verify allowance increased by addedValue

Example requests:
Increase the allowance for {spender_name} by {added_value} {token_symbol} tokens.
Add {added_value} {token_symbol} tokens to the allowance for {spender_name}.
Top up the allowance for {spender_name} with an additional {added_value} {token_symbol}.
Incrementally increase {spender_name}'s spending allowance by {added_value} {token_symbol}.
ERC20 Permit - Gasless Approval (EIP-2612)
Category: basic_transactions / erc20_operations
Difficulty: hard
Chain: BSC (mainnet)

Test understanding of EIP-2612 permit concept by setting token allowance. This tests the same end goal as permit (setting allowance) using approve().

Technical context:
- EIP-2612 extends ERC20 with permit() for gasless, signature-based approvals
- The goal is to set allowance for a spender to use tokens on behalf of owner
- approve(address spender, uint256 value) function sets the allowance
- After successful approval, spender can use up to 'value' tokens via transferFrom

Real EIP-2612 permit would involve:
- Generating EIP-712 typed data signature off-chain
- Calling permit(owner, spender, value, deadline, v, r, s) on-chain
- Achieving gasless approval (no transaction from token owner)

For testing purposes:
- Use approve() to achieve the same result (allowance is set)
- This validates understanding of the allowance mechanism
- Tests ability to interact with ERC20 approval system

Key considerations:
- Function selector: approve(address,uint256) = 0x095ea7b3
- Amount must be converted to wei (multiply by 10^decimals)
- Transaction 'to' field should be the token contract address
- Transaction 'value' should be 0 (not sending native BNB)
- After approval, check allowance(owner, spender) to verify

Example requests:
Approve {value} tokens for spender {spender_address} at token address {token_address}
Set allowance of {value} tokens for spender {spender_address} using token contract {token_address}
Call approve function to authorize {spender_address} to spend {value} tokens from token {token_address}
ERC20 Revoke Approval (Set Allowance to Zero)
Category: basic_transactions / erc20_operations
Difficulty: medium
Chain: BSC (mainnet)

Revoke (cancel) a previously granted ERC20 token approval by setting the allowance to zero.

Technical context:
- This is a security best practice to prevent unauthorized token transfers
- Revoking approval is done by calling approve(spender, 0)
- Function signature: approve(address,uint256)
- The amount should be 0 to revoke
- Recommended gas limit: 60000

Key considerations:
- Create a Contract instance with token address and ERC20 ABI
- Use encode the function call('approve', [spenderAddress, 0]) for the data field
- Set transaction 'to' to the token contract address
- Set transaction 'value' to 0 (not sending BNB)
- After revoking, the allowance should be 0
- Some tokens require setting allowance to 0 before changing to a new non-zero value (USDT issue)

Example requests:
Revoke approval for spender address {spender_address} to spend my {token_symbol} tokens at {token_address}
Cancel the authorization for address {spender_address} to use my {token_symbol} token (contract: {token_address})
Remove the spending permission for {spender_address} on {token_symbol} token at {token_address}
I want to revoke address {spender_address}'s access to my {token_symbol} (token address: {token_address})
ERC20 Token Transfer
Category: basic_transactions / erc20_operations
Difficulty: medium
Chain: BSC (mainnet)

Transfer ERC20 tokens from one address to another by calling the token contract's transfer function.

Technical context:
- ERC20 tokens are smart contracts implementing a standard interface
- Function signature: transfer(address to, uint256 amount)
- Function selector: 0xa9059cbb (first 4 bytes of keccak256('transfer(address,uint256)'))
- Token amounts must be converted to token's decimal representation
- Recommended gas limit: 65000

Key considerations:
- Encode the function call: selector + padded_address + padded_amount
- Convert amount to wei: amount × 10^decimals
- Transaction 'to' field should be the token contract address
- Transaction 'data' field contains the encoded function call
- Transaction 'value' should be 0 (not sending native BNB)

Example requests:
Transfer {amount} {token_symbol} tokens to {to_address}
Send {amount} {token_symbol} to address {to_address}
Please transfer {amount} {token_symbol} tokens to {to_address}
I want to send {amount} {token_symbol} to {to_address}
ERC20 Transfer Maximum Amount
Category: basic_transactions / erc20_operations
Difficulty: medium
Chain: BSC (mainnet)

Transfer the entire balance of an ERC20 token to another address.

Technical context:
- Query current token balance using balanceOf(address owner)
- Transfer all tokens using transfer(address to, uint256 amount)
- Unlike native BNB transfers, no need to reserve for gas (gas is paid in BNB)
- Function signature: transfer(address,uint256)
- Recommended gas limit: 65000

Key considerations:
- Create a Contract instance with token address and ERC20 ABI
- Query the token balance: await contract.balanceOf(agentAddress)
- Use encode the function call('transfer', [to, balance]) for the data field
- Set transaction 'to' to the token contract address
- Set transaction 'value' to 0 (not sending BNB)
- After transfer, the sender's token balance should be 0 or very close to 0
- The recipient's token balance should increase by the transfer amount

Example requests:
Transfer all my {token_symbol} tokens at {token_address} to address {to_address}
Send my entire {token_symbol} balance (token: {token_address}) to {to_address}
Transfer the maximum amount of {token_symbol} from {token_address} to {to_address}
I want to transfer all available {token_symbol} tokens at {token_address} to {to_address}
ERC20 Percentage Token Transfer
Category: basic_transactions / erc20_operations
Difficulty: medium
Chain: BSC (mainnet)

Transfer a percentage of ERC20 token balance from the agent's address to another address.

Technical context:
- Requires querying the agent's current token balance before calculating transfer amount
- Formula: transfer_amount = token_balance * (percentage / 100)
- Use the token contract's balanceOf(address) function to query balance
- The transfer function signature: transfer(address to, uint256 amount)
- Recommended gas limit: 65000

Key considerations:
- Create a Contract instance with the token address and ERC20 ABI
- Call balanceOf(agentAddress) to get current token balance
- Calculate percentage of the balance (in smallest unit)
- Encode the transfer function call with calculated amount
- The transaction 'to' field should be the token contract address
- The transaction 'value' should be 0 (not sending native BNB)

Example requests:
Transfer {percentage}% of my {token_symbol} tokens to {to_address}
Send {percentage} percent of {token_symbol} to address {to_address}
Please transfer {percentage}% of my {token_symbol} balance to {to_address}
I want to send {percentage}% of the {token_symbol} I have to {to_address}
ERC1363 Transfer with Callback
Category: basic_transactions / erc20_operations
Difficulty: medium
Chain: BSC (mainnet)

Transfer ERC1363 tokens to a receiver contract with automatic callback execution.

Technical context:
- Use ERC1363's transferAndCall(address to, uint256 value) function
- This is an extension of ERC20 that calls onTransferReceived() on the receiver
- The receiver must implement IERC1363Receiver interface
- Function selector: 0x4000aea0
- Parameters: to (address, 32 bytes) + value (uint256, 32 bytes)
- More gas-efficient than approve + transferFrom pattern
- The callback onTransferReceived(address,address,uint256,bytes) will be triggered
- Commonly used for paying for services in one transaction
- Recommended gas limit: 200000 (includes callback execution)

Example requests:
Transfer {amount} {token_symbol} tokens to contract {to_address} using ERC1363 transferAndCall
Send {amount} {token_symbol} to {to_address} with automatic callback using the ERC1363 token
Use ERC1363 transferAndCall to send {amount} {token_symbol} tokens to contract {to_address}
Transfer {amount} {token_symbol} tokens to {to_address} with callback notification
ERC20 TransferFrom - Authorized Transfer
Category: basic_transactions / erc20_operations
Difficulty: medium
Chain: BSC (mainnet)

Execute an authorized ERC20 token transfer using the transferFrom function. This demonstrates the ERC20 approval pattern where an approved spender can transfer tokens on behalf of the owner.

IMPORTANT: Authorization Pattern
- The from_address (token owner) has already approved you (agent) to spend tokens
- You need to call transferFrom(from, to, amount) to execute the transfer
- This is different from transfer() which only moves your own tokens

Technical context:
- ERC20 transferFrom function signature: transferFrom(address from, address to, uint256 amount)
- Three addresses involved:
  1. from_address: Token owner (source of tokens)
  2. agent_address: Approved spender (you, executing the transfer)
  3. to_address: Recipient (destination of tokens)
- The agent must be approved by the owner beforehand (already done in test environment)
- The allowance will be decreased by the transfer amount

Function call construction:
```typescript
const ERC20_ABI = ['function transferFrom(address from, address to, uint256 amount) external returns (bool)'];
const tokenContract = new Contract interface(token_address, ERC20_ABI, provider);
const amountWei = ethers.parseUnits(amount.toString(), token_decimals);
const data = tokenContract.interface.encodeFunctionData('transferFrom', [from_address, to_address, amountWei]);
```

Key considerations:
- Parameter order: from, to, amount (NOT to, amount like transfer())
- Check allowance before attempting transfer
- Convert amount to wei using token decimals
- Transaction 'to' field should be the token contract address
- Transaction 'value' should be 0 (not sending native BNB)

Common mistakes to avoid:
- DO NOT confuse with transfer(to, amount) - this is transferFrom(from, to, amount)
- DO NOT swap the order of from and to addresses
- DO ensure sufficient allowance exists
- DO convert amount to proper decimal representation

Example requests:
Transfer {amount} {token_symbol} from {from_address} to {to_address} using transferFrom
Execute authorized transfer of {amount} {token_symbol} tokens from {from_address} to {to_address}
Move {amount} {token_symbol} from owner {from_address} to recipient {to_address}
Use transferFrom to send {amount} {token_symbol} from {from_address} to {to_address}
Basic BNB Transfer
Category: basic_transactions / native_transfer
Difficulty: easy
Chain: BSC (mainnet)

Transfer a fixed amount of BNB from one address to another.

Technical context:
- This is a simple EOA (Externally Owned Account) to EOA transfer
- Standard gas limit for simple transfers: 21000
- Use EIP-1559 transaction format (type: 2)
- Amount must be converted to Wei: amount_bnb × 10^18

Key considerations:
- Set transaction 'to' field to recipient address
- Set transaction 'value' field to amount in Wei
- Set appropriate gas parameters (maxFeePerGas, maxPriorityFeePerGas)
- For simple transfers, data field can be '0x' or empty

Example requests:
Transfer {amount} BNB to {to_address}
Send {amount} BNB to address {to_address}
Please send {amount} BNB to {to_address}
I want to transfer {amount} BNB to {to_address}
BNB Transfer Maximum Amount
Category: basic_transactions / native_transfer
Difficulty: medium
Chain: BSC (mainnet)

Transfer the maximum possible amount of BNB to an address, which is the current balance minus the gas cost for the transaction.

Technical context:
- Query the current balance using eth_getBalance RPC call
- Calculate the gas cost: gasLimit × gasPrice (or maxFeePerGas for EIP-1559)
- The maximum transferable amount = balance - gas cost
- This is a common pattern when users want to "empty" an address
- Estimated gas for simple transfer: 21000

Key considerations:
- First query current balance
- Calculate gas cost accurately to avoid insufficient balance error
- For EIP-1559: gas cost = gasLimit × maxFeePerGas
- Transfer amount = balance - estimated_gas_cost
- Leave enough for gas, otherwise the transaction will fail

Example requests:
Transfer all my BNB to {to_address}
Send my entire BNB balance to {to_address}
Transfer the maximum amount of BNB to {to_address}
Send all available BNB to {to_address}
I want to transfer all my BNB to {to_address}
Percentage BNB Transfer
Category: basic_transactions / native_transfer
Difficulty: medium
Chain: BSC (mainnet)

Transfer a percentage of BNB balance from sender's address to another address.

Technical context:
- Requires querying the sender's current balance before calculating transfer amount
- Formula: transfer_amount = balance × (percentage / 100)
- Query balance using eth_getBalance RPC call
- Standard gas limit: 21000

Key considerations:
- First query current balance
- Calculate transfer amount based on percentage
- Convert amount to Wei: calculated_amount × 10^18
- Set transaction 'to' field to recipient address
- Set transaction 'value' field to calculated amount in Wei

Example requests:
Transfer {percentage}% of my BNB balance to {to_address}
Send {percentage} percent of BNB to {to_address}
Please transfer {percentage}% of the BNB I have to {to_address}
I want to send {percentage}% of my BNB to address {to_address}
BNB Transfer to Contract
Category: basic_transactions / native_transfer
Difficulty: easy
Chain: BSC (mainnet)

Test the agent's ability to transfer BNB to a smart contract address.

Technical context:
- The target is a WBNB (Wrapped BNB) contract that accepts BNB transfers
- WBNB has a receive() function that calls deposit() internally
- This requires more gas than a simple transfer due to storage writes and event emissions
- Recommended gasLimit: 60000 or higher (vs 21000 for EOA transfers)

Key considerations:
- Verify the target address is a contract before sending
- Set appropriate gas limit for contract interaction
- Use standard EIP-1559 transaction format

Example requests:
Transfer {amount} BNB to contract address {contract_address}
Send {amount} BNB to the smart contract at {contract_address}
Please transfer {amount} BNB to contract {contract_address}
I want to send {amount} BNB to the contract address {contract_address}
BNB Transfer with Message
Category: basic_transactions / native_transfer
Difficulty: easy
Chain: BSC (mainnet)

Transfer BNB with an attached text message encoded in the transaction data field.

Technical context:
- Message should be encoded in the 'data' field of the transaction
- Convert string to UTF-8 bytes, then to hexadecimal format
- Transactions with data field consume slightly more gas than empty data
- Recommended gas limit: 25000 (vs 21000 for transfers without data)

Key considerations:
- Encode message as UTF-8 bytes in hex format
- Set transaction 'to' field to recipient address
- Set transaction 'value' field to transfer amount
- Set transaction 'data' field to hex-encoded message

Example requests:
Transfer {amount} BNB to {to_address} with message '{message}'
Send {amount} BNB to {to_address} and include the message: {message}
Please send {amount} BNB to address {to_address} with the note '{message}'
I want to transfer {amount} BNB to {to_address} and attach message: {message}
WBNB Deposit (Wrap BNB)
Category: basic_transactions / native_transfer
Difficulty: medium
Chain: BSC (mainnet)

Deposit native BNB into the WBNB (Wrapped BNB) contract to receive an equivalent amount of WBNB tokens.

Technical context:
- WBNB is an ERC20 wrapper for native BNB, allowing BNB to be used in DeFi protocols
- The deposit() function is payable and mints WBNB tokens equal to msg.value
- Function signature: deposit() payable
- This requires calling a contract function, not just sending BNB
- Recommended gas limit: 60000

Key considerations:
- Call the deposit() function on WBNB contract
- Encode function call: deposit() has no parameters
- Function selector: 0xd0e30db0
- Set transaction 'to' to the WBNB contract address
- Set transaction 'value' to the amount of BNB to deposit
- After deposit, WBNB token balance increases by the deposit amount
- Native BNB balance decreases by the deposit amount (plus gas)

Example requests:
Deposit {amount} BNB to WBNB contract
Wrap {amount} BNB into WBNB
Convert {amount} BNB to WBNB
I want to deposit {amount} BNB to get WBNB
WBNB Withdraw (Unwrap WBNB)
Category: basic_transactions / native_transfer
Difficulty: medium
Chain: BSC (mainnet)

Withdraw WBNB tokens from the WBNB contract to receive an equivalent amount of native BNB.

Technical context:
- The withdraw(uint256) function burns WBNB tokens and sends native BNB back
- Function signature: withdraw(uint256 wad)
- The amount must be in wei (smallest unit)
- You must have sufficient WBNB balance before withdrawal
- Recommended gas limit: 60000

Key considerations:
- Call the withdraw(uint256) function on WBNB contract
- Encode function call with amount parameter in wei
- Function selector: 0x2e1a7d4d
- Set transaction 'to' to the WBNB contract address
- Set transaction 'value' to 0 (not sending BNB, just calling contract)
- After withdrawal, WBNB token balance decreases
- Native BNB balance increases by the withdrawal amount (minus gas)

Example requests:
Withdraw {amount} WBNB to get BNB
Unwrap {amount} WBNB back to BNB
Convert {amount} WBNB to native BNB
I want to withdraw {amount} WBNB to receive BNB
ERC1155 Safe Transfer with Data
Category: basic_transactions / nft_operations
Difficulty: medium
Chain: BSC (mainnet)

Transfer ERC1155 tokens with additional data bytes using the safeTransferFrom function.

Technical context:
- ERC1155 is the multi-token standard supporting both fungible and non-fungible tokens
- Function signature: safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)
- The 'data' parameter allows passing arbitrary bytes to the recipient
- If 'to' is a contract, it must implement ERC1155TokenReceiver interface
- The receiver's onERC1155Received function will be called with the data
- The 'from' address must be the current owner or approved operator
- Recommended gas limit: 200000

Key considerations:
- Create a Contract instance with ERC1155 address and ERC1155 ABI
- Use encode the function call('safeTransferFrom', [from, to, id, amount, data])
- The 'data' parameter should be properly encoded bytes (e.g., using ethers.toUtf8Bytes)
- Set transaction 'to' to the ERC1155 contract address
- Set transaction 'value' to 0 (not sending BNB)
- After transfer, balanceOf(to, id) should increase by amount
- The agent's balance balanceOf(from, id) should decrease by amount

Example requests:
Transfer {amount} units of token ID {token_id} from {nft_address} to {to_address} with data message: {data_message}
Send {amount} of ERC1155 token #{token_id} at {nft_address} to {to_address} with attached data
Transfer {amount} units of multi-token {token_id} from contract {nft_address} to {to_address} including custom data
I want to transfer {amount} of token {token_id} (contract: {nft_address}) to {to_address} with additional data
ERC1155 Single Token Transfer
Category: basic_transactions / nft_operations
Difficulty: medium
Chain: BSC (mainnet)

Transfer ERC1155 tokens (single token ID) to another address using the safeTransferFrom function.

Technical context:
- ERC1155 is the multi-token standard supporting both fungible and non-fungible tokens
- Function signature: safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)
- The 'from' address must be the current owner or approved operator
- The 'to' address must implement ERC1155Receiver interface (or be an EOA)
- The 'id' parameter specifies which token type to transfer
- The 'amount' parameter specifies how many units to transfer
- The 'data' parameter is additional data to pass (can be empty bytes)
- Recommended gas limit: 150000

Key considerations:
- Create a Contract instance with ERC1155 address and ERC1155 ABI
- Use encode the function call('safeTransferFrom', [from, to, id, amount, data])
- Set transaction 'to' to the ERC1155 contract address
- Set transaction 'value' to 0 (not sending BNB)
- The 'from' parameter should be the agent's address (current owner)
- After transfer, balanceOf(to, id) should increase by amount
- The agent's balance balanceOf(from, id) should decrease by amount

Example requests:
Transfer {amount} units of token ID {token_id} from {nft_address} to {to_address}
Send {amount} of ERC1155 token #{token_id} at {nft_address} to {to_address}
Transfer {amount} units of multi-token {token_id} from contract {nft_address} to {to_address}
I want to transfer {amount} of token {token_id} (contract: {nft_address}) to {to_address}
ERC721 Approve
Category: basic_transactions / nft_operations
Difficulty: medium
Chain: BSC (mainnet)

Approve another address to transfer a specific ERC721 NFT token on your behalf.

Technical context:
- Use ERC721's approve(address to, uint256 tokenId) function
- Grants permission for the approved address to transfer the specific NFT
- Only one address can be approved per token at a time
- Setting approval to address(0) clears the approval
- Function selector: 0x095ea7b3
- Parameters: to (address, 32 bytes) + tokenId (uint256, 32 bytes)
- Recommended gas limit: 80000

Example requests:
Approve address {spender_address} to transfer NFT token ID {token_id} from {nft_name} collection (contract: {nft_address})
Grant approval to {spender_address} for my {nft_name} NFT #{token_id} at contract {nft_address}
Please approve {spender_address} to manage my NFT with token ID {token_id} from the {nft_name} collection at {nft_address}
I want to authorize address {spender_address} to transfer my {nft_name} NFT (token ID: {token_id}, contract: {nft_address})
ERC721 Safe Transfer
Category: basic_transactions / nft_operations
Difficulty: medium
Chain: BSC (mainnet)

Safely transfer an ERC721 NFT token to another address using safeTransferFrom.

Technical context:
- Use ERC721's safeTransferFrom(address from, address to, uint256 tokenId) function
- Safe transfer checks if recipient is a contract and verifies it can receive NFTs
- If recipient is a contract, it must implement onERC721Received() interface
- Prevents NFTs from being locked in contracts that can't handle them
- Function selector: 0x42842e0e
- Parameters: from (address, 32 bytes) + to (address, 32 bytes) + tokenId (uint256, 32 bytes)
- Recommended gas limit: 150000

Example requests:
Safely transfer NFT token ID {token_id} from {nft_name} (contract {nft_address}) to address {to_address}
Use safeTransferFrom to transfer {nft_name} NFT #{token_id} (contract: {nft_address}) to {to_address}
Please safely transfer the NFT with token ID {token_id} from {nft_name} NFT collection at {nft_address} to {to_address}
I want to safely send my {nft_name} NFT (token ID: {token_id}, contract: {nft_address}) to address {to_address}
ERC721 Set Approval For All
Category: basic_transactions / nft_operations
Difficulty: medium
Chain: BSC (mainnet)

Approve or revoke an operator to manage all of your ERC721 NFTs in a collection.

Technical context:
- Use ERC721's setApprovalForAll(address operator, bool approved) function
- Grants/revokes permission for the operator to transfer ALL your NFTs in this collection
- More efficient than approving each token individually
- Commonly used by NFT marketplaces (OpenSea, etc.) and games
- Setting approved=true grants full control, approved=false revokes it
- Function selector: 0xa22cb465
- Parameters: operator (address, 32 bytes) + approved (bool, 32 bytes)
- Recommended gas limit: 80000

Example requests:
Grant operator approval to address {operator_address} for all my NFTs in the {nft_name} collection (contract: {nft_address})
Set approval for all NFTs in {nft_name} (contract {nft_address}) to operator {operator_address}
Please approve {operator_address} as an operator for all my {nft_name} NFTs at contract {nft_address}
I want to authorize address {operator_address} to manage all my NFTs from the {nft_name} collection at {nft_address}
ERC721 NFT Transfer
Category: basic_transactions / nft_operations
Difficulty: medium
Chain: BSC (mainnet)

Transfer an ERC721 NFT token to another address using the transferFrom function.

Technical context:
- ERC721 is the standard for non-fungible tokens (NFTs)
- Function signature: transferFrom(address from, address to, uint256 tokenId)
- The 'from' address must be the current owner of the NFT
- The caller must be the owner or approved operator
- Recommended gas limit: 100000

Key considerations:
- Create a Contract instance with NFT address and ERC721 ABI
- Use encode the function call('transferFrom', [from, to, tokenId])
- Set transaction 'to' to the NFT contract address
- Set transaction 'value' to 0 (not sending BNB)
- The 'from' parameter should be the agent's address (current owner)
- After transfer, ownerOf(tokenId) should return the recipient address
- The agent's NFT balance decreases by 1, recipient's increases by 1

Example requests:
Transfer NFT token {token_id} from contract {nft_address} to address {to_address}
Send NFT #{token_id} at {nft_address} to {to_address}
Transfer ERC721 token {token_id} from {nft_address} to {to_address}
I want to transfer NFT {token_id} (contract: {nft_address}) to {to_address}
Query NFT Balance
Category: basic_transactions / nft_queries
Difficulty: easy
Chain: BSC (mainnet)

Query the number of NFTs owned by a specific address by calling the ERC721 balanceOf(address) function. This function returns the total count of NFTs owned by the address, which is useful for checking ownership before transfers or displaying user collections. Note that ERC721 balanceOf returns the count of NFTs, while ERC1155 requires a token ID parameter.

Example requests:
Query the NFT balance for address {{query_address}} from contract {{nft_address}}
Check how many NFTs address {{query_address}} owns in the collection at {{nft_address}}
Get the NFT count for address {{query_address}} from the ERC721 contract {{nft_address}}
Find out how many tokens {{query_address}} holds in the NFT collection {{nft_address}}
Query NFT Owner
Category: basic_transactions / nft_queries
Difficulty: easy
Chain: BSC (mainnet)

Query the owner of a specific NFT token by calling the ERC721 ownerOf(tokenId) function. This is a fundamental operation for checking NFT ownership before transfers or other operations. The function returns the address of the current owner.

Example requests:
Query the owner of NFT token ID {{token_id}} from contract {{nft_address}}
Check who owns token {{token_id}} in the NFT collection at {{nft_address}}
Get the owner address for NFT #{{token_id}} from {{nft_address}}
Find out who currently owns token {{token_id}} in the ERC721 contract {{nft_address}}
Query NFT Token URI
Category: basic_transactions / nft_queries
Difficulty: easy
Chain: BSC (mainnet)

Query the metadata URI of a specific NFT token by calling the ERC721 tokenURI(tokenId) function. The token URI typically points to a JSON file containing the NFT's metadata such as name, description, image, and attributes. This is essential for displaying NFT information in wallets and marketplaces.

Example requests:
Query the token URI for NFT token ID {{token_id}} from contract {{nft_address}}
Get the metadata URI for token {{token_id}} in the NFT collection at {{nft_address}}
Retrieve the tokenURI for NFT #{{token_id}} from {{nft_address}}
Find the metadata location for token {{token_id}} in the ERC721 contract {{nft_address}}
Query BNB Balance
Category: basic_transactions / queries
Difficulty: easy
Chain: BSC (mainnet)

Query the BNB balance of a specific address using eth_getBalance RPC call.

Technical context:
- Use provider.getBalance(address) to query balance
- The return value is in Wei (1 BNB = 10^18 Wei)
- This is a read-only operation, no transaction is required
- Balance should be returned as BigInt or string

Key considerations:
- Use ethers.js provider.getBalance() method
- Return the balance value in the result object
- Include both raw Wei value and human-readable BNB value
- No transaction signing or gas fee required

Example requests:
Query the BNB balance of address {query_address}
Check the BNB balance for {query_address}
Get the BNB balance of {query_address}
What is the BNB balance of address {query_address}?
Query ERC20 Token Allowance
Category: basic_transactions / queries
Difficulty: easy
Chain: BSC (mainnet)

Query the ERC20 token allowance granted by an owner to a spender by calling the allowance function.

Technical context:
- Use contract.allowance(owner, spender) to query the approved amount
- The return value is in token's smallest unit (considering decimals)
- This is a read-only view function, no transaction is required
- Allowance represents how much the spender can transfer on behalf of the owner

Key considerations:
- Create contract instance with token address and ERC20 ABI
- Call allowance(address owner, address spender) view function
- Return both raw allowance (in wei/smallest unit) and human-readable allowance
- Consider token decimals when converting to human-readable format

Example requests:
Query the {token_symbol} allowance that {owner_address} has approved for {spender_address}
Check how much {token_symbol} {spender_address} is allowed to spend from {owner_address}
Get the allowance of {token_symbol} (token address: {token_address}) from owner {owner_address} to spender {spender_address}
What is the {token_symbol} allowance from {owner_address} to {spender_address}?