{"id": "contract_delegate_call", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "advanced_features", "subcategory": "delegate_call", "difficulty": "hard", "title": "DelegateCall - Proxy Pattern", "description": "Call a function through a proxy contract that uses delegatecall to execute logic from an implementation contract.\n\nTechnical context:\n- The proxy contract forwards calls to an implementation contract using delegatecall\n- DelegateCall executes the implementation's code in the proxy's context\n- Storage changes affect the proxy contract, not the implementation\n- msg.sender remains the original caller\n- Function signature: setValue(uint256 value)\n- Function selector: 0x55241077 (keccak256('setValue(uint256)') first 4 bytes)\n- Recommended gas limit: 100000\n\nKey considerations:\n- You call the PROXY contract, not the implementation contract\n- The proxy forwards your call using delegatecall\n- Use encode the function call('setValue', [value]) to encode\n- Set transaction 'to' to the PROXY address\n- Set transaction 'value' to 0 (not sending BNB)\n- The value will be stored in the proxy's storage\n\nDelegateCall explained:\n- Regular call: Implementation contract modifies its own storage\n- DelegateCall: Implementation's code runs, but modifies caller's (proxy's) storage\n- This is the foundation of upgradeable contracts\n\nSuccess criteria:\n- Transaction executes successfully\n- Correct proxy contract is called\n- Correct function selector is used\n- Value is stored in the PROXY contract (not implementation)\n- Implementation contract's storage remains unchanged", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["delegatecall", "proxy", "upgradeable", "advanced", "storage_context"], "parameter_names": ["implementation_address", "proxy_address", "value"], "parameters": "{\"implementation_address\": {\"description\": \"Implementation contract address (contains logic)\", \"generation\": {\"comment\": \"Implementation contract for verification\", \"env_key\": \"delegate_call_implementation_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"proxy_address\": {\"description\": \"Proxy contract address (uses delegatecall)\", \"generation\": {\"comment\": \"Use dynamically deployed proxy contract from environment\", \"env_key\": \"delegate_call_proxy_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"value\": {\"description\": \"Value to set (uint256)\", \"generation\": {\"decimals\": 0, \"max\": 9999, \"method\": \"random\", \"min\": 100}, \"role\": \"parameter\", \"type\": \"number\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls PROXY contract (not implementation)\", \"expected\": \"{proxy_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct setValue function signature\", \"expected\": \"setValue(uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Value stored in PROXY contract\", \"expected\": \"{value}\", \"type\": \"proxy_storage_updated\", \"weight\": 0.15}, {\"description\": \"Implementation contract storage remains unchanged\", \"expected\": \"unchanged\", \"type\": \"implementation_storage_unchanged\", \"weight\": 0.15}], \"pre_conditions\": [{\"address\": \"{proxy_address}\", \"description\": \"Proxy contract must exist\", \"type\": \"contract_exists\"}, {\"address\": \"{implementation_address}\", \"description\": \"Implementation contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"DelegateCallProxy + Implementation\", \"note\": \"Tests understanding of delegatecall and proxy patterns\", \"required_functions\": [\"setValue\", \"getValue\"]}, \"educational_value\": \"Understanding delegatecall is crucial for upgradeable contracts and many DeFi protocols\", \"estimated_gas\": 100000, \"requires_contract\": true, \"tags\": [\"delegatecall\", \"proxy\", \"upgradeable\", \"advanced\", \"storage_context\"]}", "source_path": "advanced_features/delegate_call/contract_delegate_call.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"advanced_features\", \"description\": [\"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\"], \"difficulty\": \"hard\", \"id\": \"contract_delegate_call\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"DelegateCallProxy + Implementation\", \"note\": \"Tests understanding of delegatecall and proxy patterns\", \"required_functions\": [\"setValue\", \"getValue\"]}, \"educational_value\": \"Understanding delegatecall is crucial for upgradeable contracts and many DeFi protocols\", \"estimated_gas\": 100000, \"requires_contract\": true, \"tags\": [\"delegatecall\", \"proxy\", \"upgradeable\", \"advanced\", \"storage_context\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"implementation_address\": {\"description\": \"Implementation contract address (contains logic)\", \"generation\": {\"comment\": \"Implementation contract for verification\", \"env_key\": \"delegate_call_implementation_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"proxy_address\": {\"description\": \"Proxy contract address (uses delegatecall)\", \"generation\": {\"comment\": \"Use dynamically deployed proxy contract from environment\", \"env_key\": \"delegate_call_proxy_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"value\": {\"description\": \"Value to set (uint256)\", \"generation\": {\"decimals\": 0, \"max\": 9999, \"method\": \"random\", \"min\": 100}, \"role\": \"parameter\", \"type\": \"number\"}}, \"subcategory\": \"delegate_call\", \"title\": \"DelegateCall - Proxy Pattern\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls PROXY contract (not implementation)\", \"expected\": \"{proxy_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct setValue function signature\", \"expected\": \"setValue(uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Value stored in PROXY contract\", \"expected\": \"{value}\", \"type\": \"proxy_storage_updated\", \"weight\": 0.15}, {\"description\": \"Implementation contract storage remains unchanged\", \"expected\": \"unchanged\", \"type\": \"implementation_storage_unchanged\", \"weight\": 0.15}], \"pre_conditions\": [{\"address\": \"{proxy_address}\", \"description\": \"Proxy contract must exist\", \"type\": \"contract_exists\"}, {\"address\": \"{implementation_address}\", \"description\": \"Implementation contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "contract_payable_fallback", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "advanced_features", "subcategory": "fallback", "difficulty": "medium", "title": "Payable Fallback - Send BNB to Contract", "description": "Send BNB directly to a contract without calling any specific function.\nThis will trigger the contract's receive() or fallback() function.\n\nTechnical context:\n- When you send BNB to a contract without calldata, it triggers receive() if it exists\n- If receive() doesn't exist, it triggers fallback() if it's payable\n- The transaction 'to' field is the contract address\n- The 'value' field contains the BNB amount to send\n- The 'data' field should be empty (0x) or omitted\n- Recommended gas limit: 100000\n\nFallback vs Receive:\n- receive() external payable: Called when BNB is sent with empty calldata\n- fallback() external payable: Called when function doesn't exist or as fallback for receive()\n- At least one must be payable for the contract to receive BNB\n\nKey considerations:\n- Do NOT include any function call data\n- Set transaction 'value' to the BNB amount (in wei)\n- Leave 'data' field empty or set to '0x'\n- The contract must have a payable receive() or fallback() function\n\nSuccess criteria:\n- Transaction executes successfully\n- Correct contract address is used\n- Correct BNB amount is sent\n- No function call data (empty data field)\n- Contract balance increases by the sent amount", "natural_language_templates": ["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)"], "chain": "BSC", "network": "mainnet", "tags": ["fallback", "receive", "payable", "direct_transfer", "advanced"], "parameter_names": ["amount", "contract_address"], "parameters": "{\"amount\": {\"description\": \"Amount of BNB to send\", \"generation\": {\"decimals\": 4, \"max\": 0.05, \"method\": \"random\", \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"contract_address\": {\"description\": \"Contract address with payable fallback/receive\", \"generation\": {\"comment\": \"Use dynamically deployed FallbackReceiver contract from environment\", \"env_key\": \"fallback_receiver_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction sent to correct contract\", \"expected\": \"{contract_address}\", \"type\": \"contract_address\", \"weight\": 0.2}, {\"description\": \"Correct BNB amount sent\", \"expected\": \"{amount}\", \"type\": \"value_sent\", \"weight\": 0.2}, {\"description\": \"No function call data (empty or 0x)\", \"expected\": \"empty\", \"type\": \"empty_data\", \"weight\": 0.15}, {\"description\": \"Contract balance increased by sent amount\", \"expected\": \"{amount}\", \"type\": \"balance_increase\", \"weight\": 0.15}], \"pre_conditions\": [{\"address\": \"{contract_address}\", \"description\": \"Contract must exist\", \"type\": \"contract_exists\"}, {\"description\": \"Agent must have sufficient BNB balance\", \"required\": \"{amount}\", \"type\": \"sufficient_balance\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"FallbackReceiver\", \"note\": \"Tests understanding of fallback/receive functions\", \"required_functions\": [\"receive() or fallback()\"]}, \"educational_value\": \"Understanding fallback/receive is important for contract interactions and DeFi protocols\", \"estimated_gas\": 100000, \"requires_contract\": true, \"tags\": [\"fallback\", \"receive\", \"payable\", \"direct_transfer\", \"advanced\"]}", "source_path": "advanced_features/fallback/contract_payable_fallback.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"advanced_features\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"contract_payable_fallback\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"FallbackReceiver\", \"note\": \"Tests understanding of fallback/receive functions\", \"required_functions\": [\"receive() or fallback()\"]}, \"educational_value\": \"Understanding fallback/receive is important for contract interactions and DeFi protocols\", \"estimated_gas\": 100000, \"requires_contract\": true, \"tags\": [\"fallback\", \"receive\", \"payable\", \"direct_transfer\", \"advanced\"]}, \"natural_language_templates\": [\"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)\"], \"parameters\": {\"amount\": {\"description\": \"Amount of BNB to send\", \"generation\": {\"decimals\": 4, \"max\": 0.05, \"method\": \"random\", \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"contract_address\": {\"description\": \"Contract address with payable fallback/receive\", \"generation\": {\"comment\": \"Use dynamically deployed FallbackReceiver contract from environment\", \"env_key\": \"fallback_receiver_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}}, \"subcategory\": \"fallback\", \"title\": \"Payable Fallback - Send BNB to Contract\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction sent to correct contract\", \"expected\": \"{contract_address}\", \"type\": \"contract_address\", \"weight\": 0.2}, {\"description\": \"Correct BNB amount sent\", \"expected\": \"{amount}\", \"type\": \"value_sent\", \"weight\": 0.2}, {\"description\": \"No function call data (empty or 0x)\", \"expected\": \"empty\", \"type\": \"empty_data\", \"weight\": 0.15}, {\"description\": \"Contract balance increased by sent amount\", \"expected\": \"{amount}\", \"type\": \"balance_increase\", \"weight\": 0.15}], \"pre_conditions\": [{\"address\": \"{contract_address}\", \"description\": \"Contract must exist\", \"type\": \"contract_exists\"}, {\"description\": \"Agent must have sufficient BNB balance\", \"required\": \"{amount}\", \"type\": \"sufficient_balance\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc20_flashloan", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "advanced_features", "subcategory": "flashloan", "difficulty": "hard", "title": "ERC20 FlashLoan - Execute Flash Loan", "description": "Execute a flash loan by calling the FlashLoan contract's executeFlashLoan function.\n\nTechnical context:\n- Flash loan allows borrowing tokens without collateral in a single transaction\n- The loan must be repaid with a fee (0.3%) in the same transaction\n- Function signature: executeFlashLoan(address token, uint256 amount)\n- Before calling, you must approve the flash loan contract to pull back tokens\n- The approval amount should be: loan amount + fee\n- After the flash loan call, the contract will transfer tokens to you, then pull them back with fee\n- If repayment fails, the entire transaction reverts\n- Recommended gas limit: 300000\n\nTransaction flow:\n1. Calculate repayment amount: amount + (amount * 0.003)\n2. Approve flash loan contract for repayment amount\n3. Call executeFlashLoan(token_address, amount)\n4. Contract transfers tokens to you (loan)\n5. Contract immediately pulls back loan + fee\n\nKey considerations:\n- You must have enough tokens to pay the fee\n- The flash loan contract must have sufficient liquidity\n- Set 'to' to the flash loan contract address\n- Set 'value' to 0 (not sending BNB)\n- The transaction data should contain the encoded executeFlashLoan call\n- Use EIP-1559 transaction type (type: 2)", "natural_language_templates": ["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"], "chain": "BSC", "network": "mainnet", "tags": ["flashloan", "defi", "advanced", "lending", "borrowing"], "parameter_names": ["amount", "fee_percentage", "flashloan_contract_address", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"amount\": {\"description\": \"Amount to borrow (in token units)\", \"generation\": {\"decimals\": 2, \"max\": 1000, \"method\": \"random\", \"min\": 100}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"fee_percentage\": {\"description\": \"Flash loan fee percentage\", \"generation\": {\"method\": \"fixed\", \"value\": 0.3}, \"role\": \"parameter\", \"type\": \"number\"}, \"flashloan_contract_address\": {\"description\": \"Flash loan provider contract address\", \"generation\": {\"comment\": \"Use dynamically deployed flash loan contract from environment\", \"env_key\": \"flashloan_receiver_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_address\": {\"description\": \"Token address to borrow (USDT)\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"USDT on BSC\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals\", \"generation\": {\"comment\": \"BSC USDT uses 18 decimals (different from Ethereum USDT which uses 6)\", \"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for natural language\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct flash loan contract\", \"expected\": \"{flashloan_contract_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct executeFlashLoan function signature\", \"expected\": \"executeFlashLoan(address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Flash loan fee paid correctly\", \"expected_fee\": \"{amount * fee_percentage / 100}\", \"type\": \"fee_paid\", \"weight\": 0.15}, {\"description\": \"Agent balance should decrease by fee amount only\", \"expected_change\": \"-{amount * fee_percentage / 100}\", \"token\": \"{token_address}\", \"type\": \"balance_unchanged\", \"weight\": 0.15}], \"pre_conditions\": [{\"address\": \"{flashloan_contract_address}\", \"description\": \"Flash loan contract must exist\", \"type\": \"contract_exists\"}, {\"description\": \"Agent must have enough tokens to pay fee\", \"min_amount\": \"{amount * fee_percentage / 100}\", \"token\": \"{token_address}\", \"type\": \"sufficient_balance\"}, {\"contract\": \"{flashloan_contract_address}\", \"description\": \"Flash loan pool must have sufficient liquidity\", \"min_amount\": \"{amount}\", \"token\": \"{token_address}\", \"type\": \"pool_liquidity\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"complexity\": \"high\", \"contract_requirements\": {\"contract_type\": \"FlashLoan\", \"note\": \"Agent must approve flash loan contract before calling executeFlashLoan\", \"required_functions\": [\"executeFlashLoan\"]}, \"educational_value\": \"Demonstrates understanding of flash loans, approvals, and atomic transactions\", \"estimated_gas\": 300000, \"requires_approval\": true, \"requires_contract\": true, \"tags\": [\"flashloan\", \"defi\", \"advanced\", \"lending\", \"borrowing\"]}", "source_path": "advanced_features/flashloan/erc20_flashloan.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"advanced_features\", \"description\": [\"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)\"], \"difficulty\": \"hard\", \"id\": \"erc20_flashloan\", \"metadata\": {\"complexity\": \"high\", \"contract_requirements\": {\"contract_type\": \"FlashLoan\", \"note\": \"Agent must approve flash loan contract before calling executeFlashLoan\", \"required_functions\": [\"executeFlashLoan\"]}, \"educational_value\": \"Demonstrates understanding of flash loans, approvals, and atomic transactions\", \"estimated_gas\": 300000, \"requires_approval\": true, \"requires_contract\": true, \"tags\": [\"flashloan\", \"defi\", \"advanced\", \"lending\", \"borrowing\"]}, \"natural_language_templates\": [\"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\"], \"parameters\": {\"amount\": {\"description\": \"Amount to borrow (in token units)\", \"generation\": {\"decimals\": 2, \"max\": 1000, \"method\": \"random\", \"min\": 100}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"fee_percentage\": {\"description\": \"Flash loan fee percentage\", \"generation\": {\"method\": \"fixed\", \"value\": 0.3}, \"role\": \"parameter\", \"type\": \"number\"}, \"flashloan_contract_address\": {\"description\": \"Flash loan provider contract address\", \"generation\": {\"comment\": \"Use dynamically deployed flash loan contract from environment\", \"env_key\": \"flashloan_receiver_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_address\": {\"description\": \"Token address to borrow (USDT)\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"USDT on BSC\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals\", \"generation\": {\"comment\": \"BSC USDT uses 18 decimals (different from Ethereum USDT which uses 6)\", \"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for natural language\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}, \"subcategory\": \"flashloan\", \"title\": \"ERC20 FlashLoan - Execute Flash Loan\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct flash loan contract\", \"expected\": \"{flashloan_contract_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct executeFlashLoan function signature\", \"expected\": \"executeFlashLoan(address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Flash loan fee paid correctly\", \"expected_fee\": \"{amount * fee_percentage / 100}\", \"type\": \"fee_paid\", \"weight\": 0.15}, {\"description\": \"Agent balance should decrease by fee amount only\", \"expected_change\": \"-{amount * fee_percentage / 100}\", \"token\": \"{token_address}\", \"type\": \"balance_unchanged\", \"weight\": 0.15}], \"pre_conditions\": [{\"address\": \"{flashloan_contract_address}\", \"description\": \"Flash loan contract must exist\", \"type\": \"contract_exists\"}, {\"description\": \"Agent must have enough tokens to pay fee\", \"min_amount\": \"{amount * fee_percentage / 100}\", \"token\": \"{token_address}\", \"type\": \"sufficient_balance\"}, {\"contract\": \"{flashloan_contract_address}\", \"description\": \"Flash loan pool must have sufficient liquidity\", \"min_amount\": \"{amount}\", \"token\": \"{token_address}\", \"type\": \"pool_liquidity\"}]}, \"version\": \"2.0.0\"}"} {"id": "query_current_block_number", "split": "atomic", "task_type": "atomic", "version": "", "category": "basic_transactions", "subcategory": "blockchain_queries", "difficulty": "easy", "title": "Query Current Block Number", "description": "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.", "natural_language_templates": ["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"], "chain": "BSC", "network": "mainnet", "tags": ["blockchain", "block", "eth_blockNumber", "query", "rpc"], "parameter_names": [], "parameters": "{}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query current block number\", \"field\": \"query_execution\", \"weight\": 50}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"block_number\"], \"weight\": 25}, {\"condition\": \"is_valid_number\", \"error_message\": \"Block number must be a valid positive integer\", \"field\": \"block_number_validity\", \"weight\": 25}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the eth_blockNumber RPC method\", \"Learn how to query blockchain state without contracts\", \"Master block height tracking\", \"Understand blockchain time progression\", \"Learn about block-based timing mechanisms\"], \"notes\": [\"eth_blockNumber returns the latest block number as hex string\", \"Block number always increases (never decreases)\", \"Different nodes may return slightly different values due to sync status\", \"This is a lightweight RPC call with minimal overhead\", \"Block number can be used to estimate time (BSC: ~3 seconds per block)\", \"Useful for checking if transaction has been mined\", \"Returns the block number at the time of query, not a specific block\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_bnb_balance\", \"query_block_timestamp\"], \"tags\": [\"blockchain\", \"block\", \"eth_blockNumber\", \"query\", \"rpc\"]}", "source_path": "basic_transactions/blockchain_queries/query_current_block_number.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"basic_transactions\", \"description\": \"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.\", \"difficulty\": \"easy\", \"id\": \"query_current_block_number\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the eth_blockNumber RPC method\", \"Learn how to query blockchain state without contracts\", \"Master block height tracking\", \"Understand blockchain time progression\", \"Learn about block-based timing mechanisms\"], \"notes\": [\"eth_blockNumber returns the latest block number as hex string\", \"Block number always increases (never decreases)\", \"Different nodes may return slightly different values due to sync status\", \"This is a lightweight RPC call with minimal overhead\", \"Block number can be used to estimate time (BSC: ~3 seconds per block)\", \"Useful for checking if transaction has been mined\", \"Returns the block number at the time of query, not a specific block\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_bnb_balance\", \"query_block_timestamp\"], \"tags\": [\"blockchain\", \"block\", \"eth_blockNumber\", \"query\", \"rpc\"]}, \"natural_language_templates\": [\"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\"], \"parameters\": {}, \"subcategory\": \"blockchain_queries\", \"title\": \"Query Current Block Number\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query current block number\", \"field\": \"query_execution\", \"weight\": 50}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"block_number\"], \"weight\": 25}, {\"condition\": \"is_valid_number\", \"error_message\": \"Block number must be a valid positive integer\", \"field\": \"block_number_validity\", \"weight\": 25}], \"type\": \"query\"}}"} {"id": "query_gas_price", "split": "atomic", "task_type": "atomic", "version": "", "category": "basic_transactions", "subcategory": "blockchain_queries", "difficulty": "easy", "title": "Query Gas Price", "description": "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.", "natural_language_templates": ["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"], "chain": "BSC", "network": "mainnet", "tags": ["blockchain", "gas", "eth_gasPrice", "getFeeData", "EIP-1559", "query", "rpc"], "parameter_names": [], "parameters": "{}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query gas price\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required EIP-1559 fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"maxFeePerGas\", \"maxPriorityFeePerGas\"], \"weight\": 30}, {\"condition\": \"is_valid_price\", \"error_message\": \"Gas prices must be valid positive values\", \"field\": \"gas_price_validity\", \"weight\": 30}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the eth_gasPrice and getFeeData RPC methods\", \"Learn about EIP-1559 gas pricing mechanism\", \"Master maxFeePerGas and maxPriorityFeePerGas parameters\", \"Understand how to optimize transaction gas costs\", \"Learn about base fee and priority fee concepts\"], \"notes\": [\"EIP-1559 introduced a new gas pricing mechanism with base fee + priority fee\", \"maxFeePerGas = base fee + maxPriorityFeePerGas (tip)\", \"maxPriorityFeePerGas is the tip paid to miners/validators\", \"BSC supports EIP-1559 since the Bruno hard fork\", \"Gas prices fluctuate based on network demand\", \"getFeeData() returns both EIP-1559 and legacy gas price\", \"Prices are returned in wei (1 Gwei = 10^9 wei)\", \"Higher priority fee means faster transaction inclusion\", \"Base fee is burned, priority fee goes to validators\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_current_block_number\"], \"tags\": [\"blockchain\", \"gas\", \"eth_gasPrice\", \"getFeeData\", \"EIP-1559\", \"query\", \"rpc\"]}", "source_path": "basic_transactions/blockchain_queries/query_gas_price.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"basic_transactions\", \"description\": \"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.\", \"difficulty\": \"easy\", \"id\": \"query_gas_price\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the eth_gasPrice and getFeeData RPC methods\", \"Learn about EIP-1559 gas pricing mechanism\", \"Master maxFeePerGas and maxPriorityFeePerGas parameters\", \"Understand how to optimize transaction gas costs\", \"Learn about base fee and priority fee concepts\"], \"notes\": [\"EIP-1559 introduced a new gas pricing mechanism with base fee + priority fee\", \"maxFeePerGas = base fee + maxPriorityFeePerGas (tip)\", \"maxPriorityFeePerGas is the tip paid to miners/validators\", \"BSC supports EIP-1559 since the Bruno hard fork\", \"Gas prices fluctuate based on network demand\", \"getFeeData() returns both EIP-1559 and legacy gas price\", \"Prices are returned in wei (1 Gwei = 10^9 wei)\", \"Higher priority fee means faster transaction inclusion\", \"Base fee is burned, priority fee goes to validators\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_current_block_number\"], \"tags\": [\"blockchain\", \"gas\", \"eth_gasPrice\", \"getFeeData\", \"EIP-1559\", \"query\", \"rpc\"]}, \"natural_language_templates\": [\"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\"], \"parameters\": {}, \"subcategory\": \"blockchain_queries\", \"title\": \"Query Gas Price\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query gas price\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required EIP-1559 fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"maxFeePerGas\", \"maxPriorityFeePerGas\"], \"weight\": 30}, {\"condition\": \"is_valid_price\", \"error_message\": \"Gas prices must be valid positive values\", \"field\": \"gas_price_validity\", \"weight\": 30}], \"type\": \"query\"}}"} {"id": "query_transaction_count_nonce", "split": "atomic", "task_type": "atomic", "version": "", "category": "basic_transactions", "subcategory": "blockchain_queries", "difficulty": "easy", "title": "Query Transaction Count (Nonce)", "description": "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.", "natural_language_templates": ["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}}"], "chain": "BSC", "network": "mainnet", "tags": ["blockchain", "nonce", "transaction_count", "eth_getTransactionCount", "query", "rpc"], "parameter_names": ["query_address"], "parameters": "{\"query_address\": {\"description\": \"Address to query transaction count for\", \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"type\": \"address\"}}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query transaction count\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"nonce\"], \"weight\": 30}, {\"condition\": \"is_valid_nonce\", \"error_message\": \"Nonce must be a valid non-negative integer\", \"field\": \"nonce_validity\", \"weight\": 30}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the eth_getTransactionCount RPC method\", \"Learn about nonce and its role in transaction ordering\", \"Master the difference between 'pending' and 'latest' states\", \"Understand replay attack protection\", \"Learn when to use which nonce state\"], \"notes\": [\"Nonce starts at 0 for new addresses\", \"Nonce increments by 1 for each transaction sent\", \"Use 'pending' state when preparing new transactions\", \"Use 'latest' state for confirmed transaction count\", \"Nonce must be sequential - gaps will cause transactions to be stuck\", \"Same nonce can be used to replace a pending transaction (with higher gas)\", \"Different providers may have slightly different pending nonces\", \"Smart contracts do not have nonces (only EOAs do)\", \"Nonce is per-address, not per-transaction\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_current_block_number\", \"query_bnb_balance\"], \"tags\": [\"blockchain\", \"nonce\", \"transaction_count\", \"eth_getTransactionCount\", \"query\", \"rpc\"]}", "source_path": "basic_transactions/blockchain_queries/query_transaction_count_nonce.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"basic_transactions\", \"description\": \"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.\", \"difficulty\": \"easy\", \"id\": \"query_transaction_count_nonce\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the eth_getTransactionCount RPC method\", \"Learn about nonce and its role in transaction ordering\", \"Master the difference between 'pending' and 'latest' states\", \"Understand replay attack protection\", \"Learn when to use which nonce state\"], \"notes\": [\"Nonce starts at 0 for new addresses\", \"Nonce increments by 1 for each transaction sent\", \"Use 'pending' state when preparing new transactions\", \"Use 'latest' state for confirmed transaction count\", \"Nonce must be sequential - gaps will cause transactions to be stuck\", \"Same nonce can be used to replace a pending transaction (with higher gas)\", \"Different providers may have slightly different pending nonces\", \"Smart contracts do not have nonces (only EOAs do)\", \"Nonce is per-address, not per-transaction\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_current_block_number\", \"query_bnb_balance\"], \"tags\": [\"blockchain\", \"nonce\", \"transaction_count\", \"eth_getTransactionCount\", \"query\", \"rpc\"]}, \"natural_language_templates\": [\"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}}\"], \"parameters\": {\"query_address\": {\"description\": \"Address to query transaction count for\", \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"type\": \"address\"}}, \"subcategory\": \"blockchain_queries\", \"title\": \"Query Transaction Count (Nonce)\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query transaction count\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"nonce\"], \"weight\": 30}, {\"condition\": \"is_valid_nonce\", \"error_message\": \"Nonce must be a valid non-negative integer\", \"field\": \"nonce_validity\", \"weight\": 30}], \"type\": \"query\"}}"} {"id": "contract_call_simple", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "contract_call", "difficulty": "medium", "title": "Simple Contract Call - Increment Counter", "description": "Call a simple contract function without parameters.\n\nTechnical context:\n- The target contract is a SimpleCounter with an increment() function\n- Function signature: increment() (no parameters, no return value)\n- This is a state-changing function that increases a counter by 1\n- Function selector: 0xd09de08a (keccak256('increment()') first 4 bytes)\n- Recommended gas limit: 50000\n\nKey considerations:\n- Create a Contract instance with the contract address and ABI\n- Use encode the function call('increment', []) to encode the call\n- Set transaction 'to' to the contract address\n- Set transaction 'data' to the encoded function call\n- Set transaction 'value' to 0 (not sending BNB)\n- The contract will emit a CounterIncremented event with the new value\n\nSuccess criteria:\n- Transaction executes successfully\n- Correct contract is called\n- Correct function selector is used\n- Counter value increases by 1", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["contract_call", "simple", "increment", "state_change", "basic"], "parameter_names": ["contract_address"], "parameters": "{\"contract_address\": {\"description\": \"SimpleCounter contract address\", \"generation\": {\"comment\": \"Use dynamically deployed SimpleCounter contract from environment\", \"env_key\": \"simple_counter_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.4}, {\"description\": \"Transaction calls correct contract\", \"expected\": \"{contract_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct increment function signature\", \"expected\": \"increment()\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Counter value increased by 1\", \"expected_change\": \"+1\", \"type\": \"counter_incremented\", \"weight\": 0.2}], \"pre_conditions\": [{\"address\": \"{contract_address}\", \"description\": \"SimpleCounter contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"SimpleCounter\", \"note\": \"A simple counter contract for testing basic contract calls\", \"required_functions\": [\"increment\", \"getCounter\"]}, \"estimated_gas\": 50000, \"requires_contract\": true, \"tags\": [\"contract_call\", \"simple\", \"increment\", \"state_change\", \"basic\"]}", "source_path": "basic_transactions/contract_call/contract_call_simple.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"contract_call_simple\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"SimpleCounter\", \"note\": \"A simple counter contract for testing basic contract calls\", \"required_functions\": [\"increment\", \"getCounter\"]}, \"estimated_gas\": 50000, \"requires_contract\": true, \"tags\": [\"contract_call\", \"simple\", \"increment\", \"state_change\", \"basic\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"contract_address\": {\"description\": \"SimpleCounter contract address\", \"generation\": {\"comment\": \"Use dynamically deployed SimpleCounter contract from environment\", \"env_key\": \"simple_counter_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}}, \"subcategory\": \"contract_call\", \"title\": \"Simple Contract Call - Increment Counter\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.4}, {\"description\": \"Transaction calls correct contract\", \"expected\": \"{contract_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct increment function signature\", \"expected\": \"increment()\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Counter value increased by 1\", \"expected_change\": \"+1\", \"type\": \"counter_incremented\", \"weight\": 0.2}], \"pre_conditions\": [{\"address\": \"{contract_address}\", \"description\": \"SimpleCounter contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "contract_call_with_params", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "contract_call", "difficulty": "medium", "title": "Contract Call with Parameters - Set Message", "description": "Call a contract function with parameters (string argument).\n\nTechnical context:\n- The target contract is a MessageBoard with a setMessage(string) function\n- Function signature: setMessage(string message)\n- This function accepts a string parameter and stores it\n- You must encode both the function selector and the parameter data\n- Function selector: 0x368b8772 (keccak256('setMessage(string)') first 4 bytes)\n- Recommended gas limit: 80000 (storage write + dynamic data)\n\nKey considerations:\n- Create a Contract instance with the contract address and ABI\n- Use encode the function call('setMessage', [message]) to encode the call\n- Set transaction 'to' to the contract address\n- Set transaction 'data' to the encoded function call (selector + encoded parameters)\n- Set transaction 'value' to 0 (not sending BNB)\n- String parameters are dynamically sized and require ABI encoding\n\nSuccess criteria:\n- Transaction executes successfully\n- Correct contract is called\n- Correct function selector is used\n- Message is correctly stored in the contract", "natural_language_templates": ["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}'"], "chain": "BSC", "network": "mainnet", "tags": ["contract_call", "parameters", "string", "abi_encoding", "intermediate"], "parameter_names": ["contract_address", "message"], "parameters": "{\"contract_address\": {\"description\": \"MessageBoard contract address\", \"generation\": {\"comment\": \"Use dynamically deployed MessageBoard contract from environment\", \"env_key\": \"message_board_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"message\": {\"description\": \"Message to set in the contract\", \"generation\": {\"method\": \"from_list\", \"values\": [\"Hello, Blockchain!\", \"GM, Web3!\", \"Testing smart contract calls\", \"Decentralization is the future\", \"Building on BSC\"]}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.4}, {\"description\": \"Transaction calls correct contract\", \"expected\": \"{contract_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct setMessage function signature\", \"expected\": \"setMessage(string)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Message correctly stored in contract\", \"expected\": \"{message}\", \"type\": \"message_stored\", \"weight\": 0.2}], \"pre_conditions\": [{\"address\": \"{contract_address}\", \"description\": \"MessageBoard contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"MessageBoard\", \"note\": \"A simple message board contract that stores and retrieves messages\", \"required_functions\": [\"setMessage\", \"getMessage\"]}, \"estimated_gas\": 80000, \"requires_contract\": true, \"tags\": [\"contract_call\", \"parameters\", \"string\", \"abi_encoding\", \"intermediate\"]}", "source_path": "basic_transactions/contract_call/contract_call_with_params.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"contract_call_with_params\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"MessageBoard\", \"note\": \"A simple message board contract that stores and retrieves messages\", \"required_functions\": [\"setMessage\", \"getMessage\"]}, \"estimated_gas\": 80000, \"requires_contract\": true, \"tags\": [\"contract_call\", \"parameters\", \"string\", \"abi_encoding\", \"intermediate\"]}, \"natural_language_templates\": [\"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}'\"], \"parameters\": {\"contract_address\": {\"description\": \"MessageBoard contract address\", \"generation\": {\"comment\": \"Use dynamically deployed MessageBoard contract from environment\", \"env_key\": \"message_board_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"message\": {\"description\": \"Message to set in the contract\", \"generation\": {\"method\": \"from_list\", \"values\": [\"Hello, Blockchain!\", \"GM, Web3!\", \"Testing smart contract calls\", \"Decentralization is the future\", \"Building on BSC\"]}, \"role\": \"parameter\", \"type\": \"string\"}}, \"subcategory\": \"contract_call\", \"title\": \"Contract Call with Parameters - Set Message\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.4}, {\"description\": \"Transaction calls correct contract\", \"expected\": \"{contract_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct setMessage function signature\", \"expected\": \"setMessage(string)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Message correctly stored in contract\", \"expected\": \"{message}\", \"type\": \"message_stored\", \"weight\": 0.2}], \"pre_conditions\": [{\"address\": \"{contract_address}\", \"description\": \"MessageBoard contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "contract_call_with_value", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "contract_call", "difficulty": "medium", "title": "Contract Call with Value - Send BNB to Payable Function", "description": "Call a payable contract function with BNB value attached.\n\nTechnical context:\n- The target contract is a DonationBox with a payable donate() function\n- Function signature: donate() payable\n- This function accepts BNB and records donations\n- You must set the transaction 'value' field to send BNB\n- Function selector: 0xed88c68e (keccak256('donate()') first 4 bytes)\n- Recommended gas limit: 100000 (storage writes and event emission)\n\nKey considerations:\n- Create a Contract instance with the contract address and ABI\n- Use encode the function call('donate', []) to encode the call\n- Set transaction 'to' to the contract address\n- Set transaction 'data' to the encoded function call\n- Set transaction 'value' to the BNB amount to send (in wei)\n- The contract's BNB balance will increase by the donation amount\n\nSuccess criteria:\n- Transaction executes successfully\n- Correct contract is called\n- Correct function selector is used\n- Correct amount of BNB is sent\n- Contract balance increases by the donation amount", "natural_language_templates": ["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"], "chain": "BSC", "network": "mainnet", "tags": ["contract_call", "payable", "value", "donation", "bnb", "intermediate"], "parameter_names": ["amount", "contract_address"], "parameters": "{\"amount\": {\"description\": \"Amount of BNB to donate\", \"generation\": {\"decimals\": 3, \"max\": 0.05, \"method\": \"random\", \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"contract_address\": {\"description\": \"DonationBox contract address\", \"generation\": {\"comment\": \"Use dynamically deployed DonationBox contract from environment\", \"env_key\": \"donation_box_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct contract\", \"expected\": \"{contract_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct donate function signature\", \"expected\": \"donate()\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Correct amount of BNB sent\", \"expected\": \"{amount}\", \"type\": \"value_sent\", \"weight\": 0.15}, {\"description\": \"Contract balance increased by donation amount\", \"expected_increase\": \"{amount}\", \"type\": \"contract_balance_increased\", \"weight\": 0.15}], \"pre_conditions\": [{\"address\": \"{contract_address}\", \"description\": \"DonationBox contract must exist\", \"type\": \"contract_exists\"}, {\"description\": \"Agent must have sufficient BNB balance\", \"min_balance\": \"0.2 BNB\", \"type\": \"balance\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"DonationBox\", \"note\": \"A simple donation box contract that accepts BNB via payable function\", \"required_functions\": [\"donate\"]}, \"estimated_gas\": 100000, \"requires_contract\": true, \"tags\": [\"contract_call\", \"payable\", \"value\", \"donation\", \"bnb\", \"intermediate\"]}", "source_path": "basic_transactions/contract_call/contract_call_with_value.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"contract_call_with_value\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"DonationBox\", \"note\": \"A simple donation box contract that accepts BNB via payable function\", \"required_functions\": [\"donate\"]}, \"estimated_gas\": 100000, \"requires_contract\": true, \"tags\": [\"contract_call\", \"payable\", \"value\", \"donation\", \"bnb\", \"intermediate\"]}, \"natural_language_templates\": [\"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\"], \"parameters\": {\"amount\": {\"description\": \"Amount of BNB to donate\", \"generation\": {\"decimals\": 3, \"max\": 0.05, \"method\": \"random\", \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"contract_address\": {\"description\": \"DonationBox contract address\", \"generation\": {\"comment\": \"Use dynamically deployed DonationBox contract from environment\", \"env_key\": \"donation_box_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}}, \"subcategory\": \"contract_call\", \"title\": \"Contract Call with Value - Send BNB to Payable Function\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct contract\", \"expected\": \"{contract_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct donate function signature\", \"expected\": \"donate()\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Correct amount of BNB sent\", \"expected\": \"{amount}\", \"type\": \"value_sent\", \"weight\": 0.15}, {\"description\": \"Contract balance increased by donation amount\", \"expected_increase\": \"{amount}\", \"type\": \"contract_balance_increased\", \"weight\": 0.15}], \"pre_conditions\": [{\"address\": \"{contract_address}\", \"description\": \"DonationBox contract must exist\", \"type\": \"contract_exists\"}, {\"description\": \"Agent must have sufficient BNB balance\", \"min_balance\": \"0.2 BNB\", \"type\": \"balance\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc20_approve", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "easy", "title": "ERC20 Token Approval", "description": "Approve a spender (Router or Contract) to spend your ERC20 tokens. This is a prerequisite for many DeFi operations like swapping or adding liquidity.\n\nThe approve function sets the allowance that a spender can use on behalf of the token owner.\n\nKey Points:\n- Function: approve(address spender, uint256 amount)\n- Sets allowance for spender to transfer tokens on your behalf\n- Does not transfer tokens, only grants permission\n- Required before operations like swap, transferFrom, addLiquidity, etc.\n- Common spenders: PancakeSwap Router, Staking Contracts, etc.\n\nTransaction Requirements:\n- Call approve() on the ERC20 token contract\n- Pass spender address and amount to approve\n- Wait for transaction confirmation\n- No BNB value needed (not payable)\n- Gas: ~50,000\n\nExample Workflow:\n1. Connect to ERC20 token contract\n2. Call approve(spenderAddress, amountInWei)\n3. Wait for confirmation\n4. Verify allowance was set correctly", "natural_language_templates": ["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."], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "approve", "allowance", "defi", "prerequisite"], "parameter_names": ["agent_address", "amount", "chain_id", "spender_address", "spender_name", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"agent_address\": {\"description\": \"Agent address (token owner)\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"amount\": {\"description\": \"Amount to approve (in token units)\", \"example\": 200.0, \"generation\": {\"decimals\": 2, \"max\": 500.0, \"method\": \"random\", \"min\": 100.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"chain_id\": {\"description\": \"BSC Mainnet chain ID\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"spender_address\": {\"description\": \"Address to approve (spender)\", \"example\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"spender_name\": {\"description\": \"Spender name for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSwap Router V2\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"example\": \"0x55d398326f99059fF775485246999027B3197955\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals (all BSC tokens use 18)\", \"example\": 18, \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{}", "source_path": "basic_transactions/erc20_operations/erc20_approve.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"common_mistakes\": [\"Forgetting to convert amount to wei (multiply by 10^decimals)\", \"Sending BNB value with approve transaction (not needed)\", \"Approving the token address instead of the spender address\", \"Not waiting for transaction confirmation before checking allowance\", \"Using transfer() instead of approve()\"], \"contracts\": {\"erc20_token\": {\"abi_functions\": [\"function approve(address spender, uint256 amount) external returns (bool)\", \"function allowance(address owner, address spender) external view returns (uint256)\", \"function balanceOf(address account) external view returns (uint256)\"], \"address\": \"dynamic\", \"name\": \"ERC20 Token (USDT/BUSD/CAKE)\"}, \"spender_contract\": {\"address\": \"dynamic\", \"description\": \"The contract that will be approved to spend tokens\", \"name\": \"Spender Contract (Router/Pool)\"}}, \"description\": [\"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\"], \"difficulty\": \"easy\", \"expected_behavior\": {\"gas_estimate\": 50000, \"state_changes\": [\"Allowance for spender increases by approved amount\", \"Token balance remains unchanged (approve does not transfer)\", \"Approval event is emitted\"], \"transaction_count\": 1}, \"hints\": [\"Use the ERC20 approve function: approve(address spender, uint256 amount)\", \"Convert the amount to wei units using token decimals (multiply by 10^18)\", \"The spender address should be the contract that will use your tokens\", \"No BNB value should be sent with this transaction (not payable)\", \"After approval, use allowance() to verify: allowance(owner, spender)\"], \"id\": \"erc20_approve\", \"natural_language_templates\": [\"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.\"], \"parameters\": {\"agent_address\": {\"description\": \"Agent address (token owner)\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"amount\": {\"description\": \"Amount to approve (in token units)\", \"example\": 200.0, \"generation\": {\"decimals\": 2, \"max\": 500.0, \"method\": \"random\", \"min\": 100.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"chain_id\": {\"description\": \"BSC Mainnet chain ID\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"spender_address\": {\"description\": \"Address to approve (spender)\", \"example\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"spender_name\": {\"description\": \"Spender name for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSwap Router V2\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"example\": \"0x55d398326f99059fF775485246999027B3197955\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals (all BSC tokens use 18)\", \"example\": 18, \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}, \"references\": [\"https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#IERC20-approve-address-uint256-\", \"https://eips.ethereum.org/EIPS/eip-20\"], \"subcategory\": \"erc20_operations\", \"tags\": [\"erc20\", \"approve\", \"allowance\", \"defi\", \"prerequisite\"], \"test_script_template\": \"erc20_approve.ts\", \"title\": \"ERC20 Token Approval\", \"validation_criteria\": {\"allowance_set_correctly\": {\"description\": \"Allowance increased by the approved amount\", \"weight\": 40}, \"correct_function_called\": {\"description\": \"Called approve(address,uint256) with correct selector\", \"weight\": 20}, \"no_token_transfer\": {\"description\": \"Token balance unchanged (approve does not transfer)\", \"weight\": 10}, \"transaction_success\": {\"description\": \"Transaction executed successfully without reverting\", \"weight\": 30}}, \"version\": \"2.0.0\"}"} {"id": "erc20_approve_and_call_1363", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "medium", "title": "ERC20 Approve with Callback (ERC1363)", "description": "Approve an address to spend ERC20 tokens and trigger an `onApprovalReceived` callback on the spender contract if it implements `IERC1363Spender`.\n\nTechnical context:\n- ERC1363 extends ERC20 with payable token functions\n- Function signature: approveAndCall(address spender, uint256 value) or approveAndCall(address spender, uint256 value, bytes data)\n- The spender must implement IERC1363Spender interface to receive callback\n- If spender is a contract implementing IERC1363Spender, onApprovalReceived will be called\n- If spender doesn't implement the interface, it works like regular approve\n- Recommended gas limit: 200000\n\nKey considerations:\n- Use the deployed ERC1363 test token (T1363)\n- Create a Contract instance with token address and ERC1363 ABI\n- The approveAndCall function combines approve and callback in one transaction\n- Set transaction 'to' to the token contract address\n- Set transaction 'value' to 0 (not sending BNB)\n- After approval, allowance(owner, spender) should return the approved amount", "natural_language_templates": ["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"], "chain": "BSC", "network": "mainnet", "tags": ["erc1363", "token", "approve", "callback", "allowance", "spender_notification", "onchain"], "parameter_names": ["amount", "spender_address", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"amount\": {\"description\": \"Amount of tokens to approve\", \"generation\": {\"decimals\": 2, \"max\": 100.0, \"method\": \"random\", \"min\": 1.0}, \"role\": \"approval_amount\", \"type\": \"number\", \"unit\": \"token\"}, \"spender_address\": {\"description\": \"Address to be approved for spending tokens\", \"generation\": {\"method\": \"random\"}, \"role\": \"spender\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC1363 token contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC1363 token from environment\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"token_contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"number\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"display\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Allowance correctly set for spender\", \"expected_allowance\": \"{amount}\", \"owner\": \"{agent_address}\", \"spender\": \"{spender_address}\", \"token\": \"{token_address}\", \"tolerance\": \"0\", \"type\": \"allowance_set\", \"weight\": 0.5}, {\"comment\": \"approveAndCall(address,uint256,bytes) selector\", \"description\": \"Correct function selector for approveAndCall\", \"expected_selector\": \"0xcae9ca51\", \"type\": \"function_selector_check\", \"weight\": 0.2}], \"pre_conditions\": [{\"address\": \"{agent_address}\", \"description\": \"Agent must have some tokens (approval doesn't require specific balance)\", \"min_balance\": \"0.001\", \"token\": \"{token_address}\", \"type\": \"balance_check\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"erc_standard\": \"ERC1363\", \"estimated_gas\": 200000, \"implementation_status\": \"development\", \"known_limitations\": [\"Most standard ERC20 tokens (USDT, USDC, DAI) do NOT support ERC1363\", \"Requires token to implement approveAndCall function\", \"If spender is a contract, it can optionally implement IERC1363Spender interface\", \"For testing, uses a custom ERC1363-compliant token\"], \"network\": \"mainnet\", \"requires_contract\": true, \"requires_custom_token\": true, \"tags\": [\"erc1363\", \"token\", \"approve\", \"callback\", \"allowance\", \"spender_notification\", \"onchain\"]}", "source_path": "basic_transactions/erc20_operations/erc20_approve_and_call_1363.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"erc20_approve_and_call_1363\", \"metadata\": {\"erc_standard\": \"ERC1363\", \"estimated_gas\": 200000, \"implementation_status\": \"development\", \"known_limitations\": [\"Most standard ERC20 tokens (USDT, USDC, DAI) do NOT support ERC1363\", \"Requires token to implement approveAndCall function\", \"If spender is a contract, it can optionally implement IERC1363Spender interface\", \"For testing, uses a custom ERC1363-compliant token\"], \"network\": \"mainnet\", \"requires_contract\": true, \"requires_custom_token\": true, \"tags\": [\"erc1363\", \"token\", \"approve\", \"callback\", \"allowance\", \"spender_notification\", \"onchain\"]}, \"natural_language_templates\": [\"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\"], \"parameters\": {\"amount\": {\"description\": \"Amount of tokens to approve\", \"generation\": {\"decimals\": 2, \"max\": 100.0, \"method\": \"random\", \"min\": 1.0}, \"role\": \"approval_amount\", \"type\": \"number\", \"unit\": \"token\"}, \"spender_address\": {\"description\": \"Address to be approved for spending tokens\", \"generation\": {\"method\": \"random\"}, \"role\": \"spender\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC1363 token contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC1363 token from environment\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"token_contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"number\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"display\", \"type\": \"string\"}}, \"subcategory\": \"erc20_operations\", \"title\": \"ERC20 Approve with Callback (ERC1363)\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Allowance correctly set for spender\", \"expected_allowance\": \"{amount}\", \"owner\": \"{agent_address}\", \"spender\": \"{spender_address}\", \"token\": \"{token_address}\", \"tolerance\": \"0\", \"type\": \"allowance_set\", \"weight\": 0.5}, {\"comment\": \"approveAndCall(address,uint256,bytes) selector\", \"description\": \"Correct function selector for approveAndCall\", \"expected_selector\": \"0xcae9ca51\", \"type\": \"function_selector_check\", \"weight\": 0.2}], \"pre_conditions\": [{\"address\": \"{agent_address}\", \"description\": \"Agent must have some tokens (approval doesn't require specific balance)\", \"min_balance\": \"0.001\", \"token\": \"{token_address}\", \"type\": \"balance_check\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc20_burn", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "medium", "title": "ERC20 Token Burn", "description": "Burn (destroy) ERC20 tokens by transferring them to the zero address (0x0000...0000), permanently removing them from circulation.\n\nTechnical context:\n- Most ERC20 tokens don't have a dedicated burn() function\n- The standard way to burn tokens is to transfer them to address(0)\n- Zero address: 0x0000000000000000000000000000000000000000\n- Once sent to zero address, tokens are permanently lost\n- Function signature: transfer(address to, uint256 amount)\n- Recommended gas limit: 70000\n\nKey considerations:\n- Create a Contract instance with token address and standard ERC20 ABI\n- Use encode the function call('transfer', [zeroAddress, amount])\n- Set transaction 'to' to the token contract address\n- Set transaction 'value' to 0 (not sending BNB)\n- The 'to' parameter in transfer should be the zero address\n- After burning, your token balance decreases\n- Burned tokens are sent to 0x0000000000000000000000000000000000000000", "natural_language_templates": ["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"], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "burn", "destroy", "deflation", "intermediate"], "parameter_names": ["amount", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"amount\": {\"description\": \"Amount of tokens to burn\", \"generation\": {\"decimals\": 3, \"max\": 1.0, \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"tokens\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC1363 test token (T1363)\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"from_list\", \"values\": [18]}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for natural language\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct token contract\", \"expected\": \"{token_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct transfer function signature (to zero address)\", \"expected\": \"transfer(address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Token balance decreased by burn amount\", \"expected_decrease\": \"{amount}\", \"type\": \"balance_decrease\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient token balance\", \"min_balance\": \"100 tokens\", \"token\": \"{token_address}\", \"type\": \"token_balance\"}, {\"address\": \"{token_address}\", \"description\": \"Token contract must exist\", \"type\": \"contract_exists\"}, {\"contract\": \"{token_address}\", \"description\": \"Token must have transfer function\", \"function\": \"transfer(address,uint256)\", \"type\": \"function_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"ERC20\", \"note\": \"Token must support burn function and agent must have tokens\", \"required_functions\": [\"burn\", \"balanceOf\"]}, \"estimated_gas\": 70000, \"requires_contract\": true, \"requires_token_balance\": true, \"tags\": [\"erc20\", \"burn\", \"destroy\", \"deflation\", \"intermediate\"]}", "source_path": "basic_transactions/erc20_operations/erc20_burn.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"erc20_burn\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"ERC20\", \"note\": \"Token must support burn function and agent must have tokens\", \"required_functions\": [\"burn\", \"balanceOf\"]}, \"estimated_gas\": 70000, \"requires_contract\": true, \"requires_token_balance\": true, \"tags\": [\"erc20\", \"burn\", \"destroy\", \"deflation\", \"intermediate\"]}, \"natural_language_templates\": [\"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\"], \"parameters\": {\"amount\": {\"description\": \"Amount of tokens to burn\", \"generation\": {\"decimals\": 3, \"max\": 1.0, \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"tokens\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC1363 test token (T1363)\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"from_list\", \"values\": [18]}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for natural language\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"parameter\", \"type\": \"string\"}}, \"subcategory\": \"erc20_operations\", \"title\": \"ERC20 Token Burn\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct token contract\", \"expected\": \"{token_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct transfer function signature (to zero address)\", \"expected\": \"transfer(address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Token balance decreased by burn amount\", \"expected_decrease\": \"{amount}\", \"type\": \"balance_decrease\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient token balance\", \"min_balance\": \"100 tokens\", \"token\": \"{token_address}\", \"type\": \"token_balance\"}, {\"address\": \"{token_address}\", \"description\": \"Token contract must exist\", \"type\": \"contract_exists\"}, {\"contract\": \"{token_address}\", \"description\": \"Token must have transfer function\", \"function\": \"transfer(address,uint256)\", \"type\": \"function_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc20_decrease_allowance", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "easy-medium", "title": "ERC20 Decrease Allowance", "description": "Decrease the allowance for a spender (Router or Contract) by a specified amount. This safely reduces an existing allowance without completely revoking it.\n\nThe decreaseAllowance function subtracts from the existing allowance and includes underflow protection.\n\nKey Points:\n- Function: decreaseAllowance(address spender, uint256 subtractedValue)\n- Subtracts subtractedValue from the current allowance\n- Safer than calling approve(spender, 0) to revoke\n- Includes built-in underflow protection\n- Will revert if subtractedValue > current allowance\n\nTechnical Details:\n- Function selector: 0xa457c2d7\n- New allowance = current allowance - subtractedValue\n- Requires: subtractedValue <= current allowance\n- Automatically prevents underflow (Solidity 0.8+)\n- Transaction will FAIL if trying to subtract more than current allowance\n\nTransaction Requirements:\n- Call decreaseAllowance() on the ERC20 token contract\n- Pass spender address and amount to subtract\n- Ensure subtractedValue <= current allowance\n- Wait for transaction confirmation\n- No BNB value needed (not payable)\n- Gas: ~50,000\n\nExample Workflow:\n1. Query current allowance (important!)\n2. Ensure subtractedValue <= current allowance\n3. Call decreaseAllowance(spenderAddress, subtractedValueInWei)\n4. Wait for confirmation\n5. Verify allowance decreased by subtractedValue", "natural_language_templates": ["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}."], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "allowance", "decrease", "safe", "revoke"], "parameter_names": ["agent_address", "chain_id", "spender_address", "spender_name", "subtracted_value", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"agent_address\": {\"description\": \"Agent address (token owner)\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"chain_id\": {\"description\": \"BSC Mainnet chain ID\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"spender_address\": {\"description\": \"Address to decrease allowance for (spender)\", \"example\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"spender_name\": {\"description\": \"Spender name for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSwap Router V2\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"subtracted_value\": {\"description\": \"Amount to subtract from allowance (in token units)\", \"example\": 100.0, \"generation\": {\"decimals\": 2, \"max\": 200.0, \"method\": \"random\", \"min\": 50.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"example\": \"0x55d398326f99059fF775485246999027B3197955\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals (all BSC tokens use 18)\", \"example\": 18, \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{}", "source_path": "basic_transactions/erc20_operations/erc20_decrease_allowance.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"common_mistakes\": [\"Using approve(spender, 0) instead of decreaseAllowance()\", \"Not checking current allowance before calling (causing underflow revert)\", \"Forgetting to convert subtractedValue to wei\", \"Sending BNB value with the transaction (not needed)\", \"Confusing spender address with token address\", \"Not understanding this SUBTRACTS from existing allowance (not sets)\"], \"contracts\": {\"erc20_token\": {\"abi_functions\": [\"function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool)\", \"function allowance(address owner, address spender) external view returns (uint256)\", \"function balanceOf(address account) external view returns (uint256)\"], \"address\": \"dynamic\", \"name\": \"ERC20 Token (USDT)\"}, \"spender_contract\": {\"address\": \"dynamic\", \"description\": \"The contract whose allowance will be decreased\", \"name\": \"Spender Contract (Router/Pool)\"}}, \"description\": [\"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\"], \"difficulty\": \"easy-medium\", \"expected_behavior\": {\"gas_estimate\": 50000, \"possible_failures\": [\"Transaction reverts if subtractedValue > current allowance\"], \"state_changes\": [\"Allowance for spender decreases by subtractedValue\", \"Token balance remains unchanged\", \"Approval event is emitted\"], \"transaction_count\": 1}, \"hints\": [\"Use the ERC20 decreaseAllowance function: decreaseAllowance(address spender, uint256 subtractedValue)\", \"Convert the subtractedValue to wei units (multiply by 10^18)\", \"Check current allowance FIRST to ensure subtractedValue <= current allowance\", \"The new allowance will be: current allowance - subtractedValue\", \"No BNB value should be sent with this transaction (not payable)\", \"Transaction will FAIL if you try to subtract more than the current allowance\"], \"id\": \"erc20_decrease_allowance\", \"natural_language_templates\": [\"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}.\"], \"parameters\": {\"agent_address\": {\"description\": \"Agent address (token owner)\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"chain_id\": {\"description\": \"BSC Mainnet chain ID\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"spender_address\": {\"description\": \"Address to decrease allowance for (spender)\", \"example\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"spender_name\": {\"description\": \"Spender name for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSwap Router V2\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"subtracted_value\": {\"description\": \"Amount to subtract from allowance (in token units)\", \"example\": 100.0, \"generation\": {\"decimals\": 2, \"max\": 200.0, \"method\": \"random\", \"min\": 50.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"example\": \"0x55d398326f99059fF775485246999027B3197955\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals (all BSC tokens use 18)\", \"example\": 18, \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}, \"references\": [\"https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20-decreaseAllowance-address-uint256-\", \"https://eips.ethereum.org/EIPS/eip-20\"], \"subcategory\": \"erc20_operations\", \"tags\": [\"erc20\", \"allowance\", \"decrease\", \"safe\", \"revoke\"], \"test_script_template\": \"erc20_decrease_allowance.ts\", \"title\": \"ERC20 Decrease Allowance\", \"validation_criteria\": {\"allowance_decreased_correctly\": {\"description\": \"Allowance decreased by the specified subtractedValue\", \"weight\": 40}, \"correct_function_called\": {\"description\": \"Called decreaseAllowance(address,uint256) with correct selector\", \"weight\": 20}, \"no_token_transfer\": {\"description\": \"Token balance unchanged (only allowance modified)\", \"weight\": 10}, \"transaction_success\": {\"description\": \"Transaction executed successfully without reverting\", \"weight\": 30}}, \"version\": \"2.0.0\"}"} {"id": "erc20_increase_allowance", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "easy", "title": "ERC20 Increase Allowance", "description": "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.\n\nThe increaseAllowance function adds to the existing allowance instead of overwriting it.\n\nKey Points:\n- Function: increaseAllowance(address spender, uint256 addedValue)\n- Adds addedValue to the current allowance\n- Safer than approve() for incremental changes\n- Prevents front-running race conditions\n- Common use case: topping up an existing allowance\n\nTechnical Details:\n- Function selector: 0x39509351\n- New allowance = current allowance + addedValue\n- No risk of underflow (only addition)\n- Automatically prevents overflow (Solidity 0.8+)\n\nTransaction Requirements:\n- Call increaseAllowance() on the ERC20 token contract\n- Pass spender address and amount to add\n- Wait for transaction confirmation\n- No BNB value needed (not payable)\n- Gas: ~50,000\n\nExample Workflow:\n1. Query current allowance (optional)\n2. Call increaseAllowance(spenderAddress, addedValueInWei)\n3. Wait for confirmation\n4. Verify allowance increased by addedValue", "natural_language_templates": ["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}."], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "allowance", "increase", "safe", "approval"], "parameter_names": ["added_value", "agent_address", "chain_id", "spender_address", "spender_name", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"added_value\": {\"description\": \"Amount to add to allowance (in token units)\", \"example\": 100.0, \"generation\": {\"decimals\": 2, \"max\": 200.0, \"method\": \"random\", \"min\": 50.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"agent_address\": {\"description\": \"Agent address (token owner)\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"chain_id\": {\"description\": \"BSC Mainnet chain ID\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"spender_address\": {\"description\": \"Address to increase allowance for (spender)\", \"example\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"spender_name\": {\"description\": \"Spender name for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSwap Router V2\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"example\": \"0x55d398326f99059fF775485246999027B3197955\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals (all BSC tokens use 18)\", \"example\": 18, \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{}", "source_path": "basic_transactions/erc20_operations/erc20_increase_allowance.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"common_mistakes\": [\"Using approve() instead of increaseAllowance()\", \"Forgetting to convert addedValue to wei\", \"Sending BNB value with the transaction (not needed)\", \"Confusing spender address with token address\", \"Not understanding this ADDS to existing allowance (not sets)\"], \"contracts\": {\"erc20_token\": {\"abi_functions\": [\"function increaseAllowance(address spender, uint256 addedValue) external returns (bool)\", \"function allowance(address owner, address spender) external view returns (uint256)\", \"function balanceOf(address account) external view returns (uint256)\"], \"address\": \"dynamic\", \"name\": \"ERC20 Token (USDT)\"}, \"spender_contract\": {\"address\": \"dynamic\", \"description\": \"The contract whose allowance will be increased\", \"name\": \"Spender Contract (Router/Pool)\"}}, \"description\": [\"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\"], \"difficulty\": \"easy\", \"expected_behavior\": {\"gas_estimate\": 50000, \"state_changes\": [\"Allowance for spender increases by addedValue\", \"Token balance remains unchanged\", \"Approval event is emitted\"], \"transaction_count\": 1}, \"hints\": [\"Use the ERC20 increaseAllowance function: increaseAllowance(address spender, uint256 addedValue)\", \"Convert the addedValue to wei units (multiply by 10^18)\", \"The new allowance will be: current allowance + addedValue\", \"No BNB value should be sent with this transaction (not payable)\", \"This is safer than approve() for incremental changes\"], \"id\": \"erc20_increase_allowance\", \"natural_language_templates\": [\"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}.\"], \"parameters\": {\"added_value\": {\"description\": \"Amount to add to allowance (in token units)\", \"example\": 100.0, \"generation\": {\"decimals\": 2, \"max\": 200.0, \"method\": \"random\", \"min\": 50.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"agent_address\": {\"description\": \"Agent address (token owner)\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"chain_id\": {\"description\": \"BSC Mainnet chain ID\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"spender_address\": {\"description\": \"Address to increase allowance for (spender)\", \"example\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"spender_name\": {\"description\": \"Spender name for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSwap Router V2\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"example\": \"0x55d398326f99059fF775485246999027B3197955\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals (all BSC tokens use 18)\", \"example\": 18, \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}, \"references\": [\"https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20-increaseAllowance-address-uint256-\", \"https://eips.ethereum.org/EIPS/eip-20\"], \"subcategory\": \"erc20_operations\", \"tags\": [\"erc20\", \"allowance\", \"increase\", \"safe\", \"approval\"], \"test_script_template\": \"erc20_increase_allowance.ts\", \"title\": \"ERC20 Increase Allowance\", \"validation_criteria\": {\"allowance_increased_correctly\": {\"description\": \"Allowance increased by the specified addedValue\", \"weight\": 40}, \"correct_function_called\": {\"description\": \"Called increaseAllowance(address,uint256) with correct selector\", \"weight\": 20}, \"no_token_transfer\": {\"description\": \"Token balance unchanged (only allowance modified)\", \"weight\": 10}, \"transaction_success\": {\"description\": \"Transaction executed successfully without reverting\", \"weight\": 30}}, \"version\": \"2.0.0\"}"} {"id": "erc20_permit", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "hard", "title": "ERC20 Permit - Gasless Approval (EIP-2612)", "description": "Test understanding of EIP-2612 permit concept by setting token allowance. This tests the same end goal as permit (setting allowance) using approve().\n\nTechnical context:\n- EIP-2612 extends ERC20 with permit() for gasless, signature-based approvals\n- The goal is to set allowance for a spender to use tokens on behalf of owner\n- approve(address spender, uint256 value) function sets the allowance\n- After successful approval, spender can use up to 'value' tokens via transferFrom\n\nReal EIP-2612 permit would involve:\n- Generating EIP-712 typed data signature off-chain\n- Calling permit(owner, spender, value, deadline, v, r, s) on-chain\n- Achieving gasless approval (no transaction from token owner)\n\nFor testing purposes:\n- Use approve() to achieve the same result (allowance is set)\n- This validates understanding of the allowance mechanism\n- Tests ability to interact with ERC20 approval system\n\nKey considerations:\n- Function selector: approve(address,uint256) = 0x095ea7b3\n- Amount must be converted to wei (multiply by 10^decimals)\n- Transaction 'to' field should be the token contract address\n- Transaction 'value' should be 0 (not sending native BNB)\n- After approval, check allowance(owner, spender) to verify", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["eip-2612", "permit", "signature", "eip-712", "gasless-approval", "meta-transaction", "cryptography", "advanced"], "parameter_names": ["deadline", "owner_address", "spender_address", "token_address", "token_decimals", "token_symbol", "value"], "parameters": "{\"deadline\": {\"description\": \"Timestamp deadline for signature validity (use future timestamp)\", \"generation\": {\"comment\": \"Fixed future timestamp (May 18, 2033)\", \"method\": \"fixed\", \"value\": 2000000000}, \"role\": \"signature_deadline\", \"type\": \"number\"}, \"owner_address\": {\"description\": \"Token owner address (must sign the permit)\", \"generation\": {\"comment\": \"The agent is the owner who signs the permit\", \"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"token_owner\", \"type\": \"address\"}, \"spender_address\": {\"description\": \"Address to be approved for spending\", \"generation\": {\"method\": \"random\"}, \"role\": \"approved_spender\", \"type\": \"address\"}, \"token_address\": {\"description\": \"EIP-2612 compliant token contract address\", \"generation\": {\"comment\": \"Use ERC1363 token to simulate permit scenario (has approve functionality)\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"token_contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"number\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"display\", \"type\": \"string\"}, \"value\": {\"description\": \"Amount of tokens to approve\", \"generation\": {\"decimals\": 2, \"max\": 1000.0, \"method\": \"random\", \"min\": 100.0}, \"role\": \"approval_amount\", \"type\": \"number\", \"unit\": \"token\"}}", "validation": "{}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"difficulty_notes\": [\"Requires understanding of EIP-712 typed data\", \"Must construct proper domain separator\", \"Must query and use correct nonce\", \"Signature must be from correct private key\", \"Must handle deadline timestamp\"], \"erc_standard\": \"EIP-2612\", \"estimated_gas\": 80000, \"implementation_status\": \"development\", \"known_limitations\": [\"Most standard ERC20 tokens do NOT support EIP-2612\", \"Requires proper EIP-712 signature generation\", \"Complex cryptographic signature construction\", \"Nonce must be queried from contract\", \"Domain separator must match contract's domain\"], \"network\": \"mainnet\", \"requires_contract\": true, \"requires_custom_token\": true, \"requires_signature\": true, \"tags\": [\"eip-2612\", \"permit\", \"signature\", \"eip-712\", \"gasless-approval\", \"meta-transaction\", \"cryptography\", \"advanced\"]}", "source_path": "basic_transactions/erc20_operations/erc20_permit.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"hard\", \"id\": \"erc20_permit\", \"metadata\": {\"difficulty_notes\": [\"Requires understanding of EIP-712 typed data\", \"Must construct proper domain separator\", \"Must query and use correct nonce\", \"Signature must be from correct private key\", \"Must handle deadline timestamp\"], \"erc_standard\": \"EIP-2612\", \"estimated_gas\": 80000, \"implementation_status\": \"development\", \"known_limitations\": [\"Most standard ERC20 tokens do NOT support EIP-2612\", \"Requires proper EIP-712 signature generation\", \"Complex cryptographic signature construction\", \"Nonce must be queried from contract\", \"Domain separator must match contract's domain\"], \"network\": \"mainnet\", \"requires_contract\": true, \"requires_custom_token\": true, \"requires_signature\": true, \"tags\": [\"eip-2612\", \"permit\", \"signature\", \"eip-712\", \"gasless-approval\", \"meta-transaction\", \"cryptography\", \"advanced\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"deadline\": {\"description\": \"Timestamp deadline for signature validity (use future timestamp)\", \"generation\": {\"comment\": \"Fixed future timestamp (May 18, 2033)\", \"method\": \"fixed\", \"value\": 2000000000}, \"role\": \"signature_deadline\", \"type\": \"number\"}, \"owner_address\": {\"description\": \"Token owner address (must sign the permit)\", \"generation\": {\"comment\": \"The agent is the owner who signs the permit\", \"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"token_owner\", \"type\": \"address\"}, \"spender_address\": {\"description\": \"Address to be approved for spending\", \"generation\": {\"method\": \"random\"}, \"role\": \"approved_spender\", \"type\": \"address\"}, \"token_address\": {\"description\": \"EIP-2612 compliant token contract address\", \"generation\": {\"comment\": \"Use ERC1363 token to simulate permit scenario (has approve functionality)\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"token_contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"number\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"display\", \"type\": \"string\"}, \"value\": {\"description\": \"Amount of tokens to approve\", \"generation\": {\"decimals\": 2, \"max\": 1000.0, \"method\": \"random\", \"min\": 100.0}, \"role\": \"approval_amount\", \"type\": \"number\", \"unit\": \"token\"}}, \"post_conditions\": [{\"description\": \"Permit transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.4}, {\"description\": \"Allowance correctly set to approved value\", \"expected_allowance\": \"{value}\", \"owner\": \"{owner_address}\", \"spender\": \"{spender_address}\", \"token\": \"{token_address}\", \"tolerance\": \"0\", \"type\": \"allowance_set\", \"weight\": 0.6}], \"pre_conditions\": [{\"address\": \"{token_address}\", \"description\": \"Token must be a deployed EIP-2612 compliant contract\", \"type\": \"contract_check\"}, {\"address\": \"{token_address}\", \"description\": \"Token must implement permit function\", \"function\": \"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\", \"type\": \"function_exists\"}], \"subcategory\": \"erc20_operations\", \"title\": \"ERC20 Permit - Gasless Approval (EIP-2612)\", \"version\": \"2.0.0\"}"} {"id": "erc20_revoke_approval", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "medium", "title": "ERC20 Revoke Approval (Set Allowance to Zero)", "description": "Revoke (cancel) a previously granted ERC20 token approval by setting the allowance to zero.\n\nTechnical context:\n- This is a security best practice to prevent unauthorized token transfers\n- Revoking approval is done by calling approve(spender, 0)\n- Function signature: approve(address,uint256)\n- The amount should be 0 to revoke\n- Recommended gas limit: 60000\n\nKey considerations:\n- Create a Contract instance with token address and ERC20 ABI\n- Use encode the function call('approve', [spenderAddress, 0]) for the data field\n- Set transaction 'to' to the token contract address\n- Set transaction 'value' to 0 (not sending BNB)\n- After revoking, the allowance should be 0\n- Some tokens require setting allowance to 0 before changing to a new non-zero value (USDT issue)", "natural_language_templates": ["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})"], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "approve", "revoke", "security", "allowance", "intermediate"], "parameter_names": ["spender_address", "spender_name", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"spender_address\": {\"description\": \"Address to revoke approval from (typically a DeFi contract)\", \"generation\": {\"addresses\": [\"0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"0x13f4EA83D0bd40E75C8222255bc855a974568Dd4\", \"0x1b81D678ffb9C0263b24A97847620C99d213eB14\"], \"comment\": \"PancakeSwap Router, Venus Protocol, PancakeSwap V3 Router\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"spender_name\": {\"description\": \"Human-readable name of the spender for natural language\", \"generation\": {\"method\": \"from_list\", \"values\": [\"PancakeSwap Router\", \"Venus Protocol\", \"PancakeSwap V3 Router\"]}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"USDT on BSC Mainnet\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"from_list\", \"values\": [18]}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for natural language\", \"generation\": {\"method\": \"from_list\", \"values\": [\"USDT\"]}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct token contract\", \"expected\": \"{token_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct approve function signature\", \"expected\": \"approve(address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Allowance set to zero\", \"expected_allowance\": \"0\", \"spender\": \"{spender_address}\", \"token\": \"{token_address}\", \"type\": \"allowance_revoked\", \"weight\": 0.3}], \"pre_conditions\": [{\"address\": \"{token_address}\", \"description\": \"Token contract must exist\", \"type\": \"contract_exists\"}, {\"description\": \"There should be an existing approval to revoke\", \"note\": \"We will set an initial allowance before testing revoke\", \"spender\": \"{spender_address}\", \"token\": \"{token_address}\", \"type\": \"allowance_granted\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"ERC20\", \"note\": \"Revoking approval is a security best practice\", \"required_functions\": [\"approve\", \"allowance\"]}, \"estimated_gas\": 60000, \"requires_contract\": true, \"requires_token_balance\": false, \"tags\": [\"erc20\", \"approve\", \"revoke\", \"security\", \"allowance\", \"intermediate\"]}", "source_path": "basic_transactions/erc20_operations/erc20_revoke_approval.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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)\"], \"difficulty\": \"medium\", \"id\": \"erc20_revoke_approval\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"ERC20\", \"note\": \"Revoking approval is a security best practice\", \"required_functions\": [\"approve\", \"allowance\"]}, \"estimated_gas\": 60000, \"requires_contract\": true, \"requires_token_balance\": false, \"tags\": [\"erc20\", \"approve\", \"revoke\", \"security\", \"allowance\", \"intermediate\"]}, \"natural_language_templates\": [\"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})\"], \"parameters\": {\"spender_address\": {\"description\": \"Address to revoke approval from (typically a DeFi contract)\", \"generation\": {\"addresses\": [\"0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"0x13f4EA83D0bd40E75C8222255bc855a974568Dd4\", \"0x1b81D678ffb9C0263b24A97847620C99d213eB14\"], \"comment\": \"PancakeSwap Router, Venus Protocol, PancakeSwap V3 Router\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"spender_name\": {\"description\": \"Human-readable name of the spender for natural language\", \"generation\": {\"method\": \"from_list\", \"values\": [\"PancakeSwap Router\", \"Venus Protocol\", \"PancakeSwap V3 Router\"]}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"USDT on BSC Mainnet\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"from_list\", \"values\": [18]}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for natural language\", \"generation\": {\"method\": \"from_list\", \"values\": [\"USDT\"]}, \"role\": \"parameter\", \"type\": \"string\"}}, \"subcategory\": \"erc20_operations\", \"title\": \"ERC20 Revoke Approval (Set Allowance to Zero)\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct token contract\", \"expected\": \"{token_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct approve function signature\", \"expected\": \"approve(address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Allowance set to zero\", \"expected_allowance\": \"0\", \"spender\": \"{spender_address}\", \"token\": \"{token_address}\", \"type\": \"allowance_revoked\", \"weight\": 0.3}], \"pre_conditions\": [{\"address\": \"{token_address}\", \"description\": \"Token contract must exist\", \"type\": \"contract_exists\"}, {\"description\": \"There should be an existing approval to revoke\", \"note\": \"We will set an initial allowance before testing revoke\", \"spender\": \"{spender_address}\", \"token\": \"{token_address}\", \"type\": \"allowance_granted\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc20_transfer_fixed", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "medium", "title": "ERC20 Token Transfer", "description": "Transfer ERC20 tokens from one address to another by calling the token contract's transfer function.\n\nTechnical context:\n- ERC20 tokens are smart contracts implementing a standard interface\n- Function signature: transfer(address to, uint256 amount)\n- Function selector: 0xa9059cbb (first 4 bytes of keccak256('transfer(address,uint256)'))\n- Token amounts must be converted to token's decimal representation\n- Recommended gas limit: 65000\n\nKey considerations:\n- Encode the function call: selector + padded_address + padded_amount\n- Convert amount to wei: amount × 10^decimals\n- Transaction 'to' field should be the token contract address\n- Transaction 'data' field contains the encoded function call\n- Transaction 'value' should be 0 (not sending native BNB)", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "token", "transfer", "contract_call", "intermediate"], "parameter_names": ["amount", "to_address", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"amount\": {\"description\": \"Transfer amount in tokens\", \"generation\": {\"decimals\": 2, \"max\": 100.0, \"method\": \"random\", \"min\": 1.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"BSC Mainnet USDT - widely used stablecoin\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"comment\": \"BSC USDT uses 18 decimals (different from Ethereum USDT which uses 6)\", \"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls the correct token contract\", \"expected\": \"{token_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct ERC20 transfer function signature\", \"expected\": \"transfer(address,uint256)\", \"selector\": \"0xa9059cbb\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Token balance changed correctly\", \"receiver_change\": \"+{amount}\", \"sender_change\": \"-{amount}\", \"tolerance\": \"0\", \"type\": \"token_balance_change\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient token balance\", \"min_balance\": \"200 tokens\", \"type\": \"token_balance\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"required_functions\": [\"transfer\", \"balanceOf\"], \"standard\": \"ERC20\"}, \"erc_standard\": \"ERC20\", \"estimated_gas\": 65000, \"requires_contract\": true, \"tags\": [\"erc20\", \"token\", \"transfer\", \"contract_call\", \"intermediate\"]}", "source_path": "basic_transactions/erc20_operations/erc20_transfer_fixed.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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)\"], \"difficulty\": \"medium\", \"id\": \"erc20_transfer_fixed\", \"metadata\": {\"contract_requirements\": {\"required_functions\": [\"transfer\", \"balanceOf\"], \"standard\": \"ERC20\"}, \"erc_standard\": \"ERC20\", \"estimated_gas\": 65000, \"requires_contract\": true, \"tags\": [\"erc20\", \"token\", \"transfer\", \"contract_call\", \"intermediate\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"amount\": {\"description\": \"Transfer amount in tokens\", \"generation\": {\"decimals\": 2, \"max\": 100.0, \"method\": \"random\", \"min\": 1.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"BSC Mainnet USDT - widely used stablecoin\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"comment\": \"BSC USDT uses 18 decimals (different from Ethereum USDT which uses 6)\", \"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}}, \"subcategory\": \"erc20_operations\", \"title\": \"ERC20 Token Transfer\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls the correct token contract\", \"expected\": \"{token_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct ERC20 transfer function signature\", \"expected\": \"transfer(address,uint256)\", \"selector\": \"0xa9059cbb\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Token balance changed correctly\", \"receiver_change\": \"+{amount}\", \"sender_change\": \"-{amount}\", \"tolerance\": \"0\", \"type\": \"token_balance_change\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient token balance\", \"min_balance\": \"200 tokens\", \"type\": \"token_balance\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc20_transfer_max_amount", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "medium", "title": "ERC20 Transfer Maximum Amount", "description": "Transfer the entire balance of an ERC20 token to another address.\n\nTechnical context:\n- Query current token balance using balanceOf(address owner)\n- Transfer all tokens using transfer(address to, uint256 amount)\n- Unlike native BNB transfers, no need to reserve for gas (gas is paid in BNB)\n- Function signature: transfer(address,uint256)\n- Recommended gas limit: 65000\n\nKey considerations:\n- Create a Contract instance with token address and ERC20 ABI\n- Query the token balance: await contract.balanceOf(agentAddress)\n- Use encode the function call('transfer', [to, balance]) for the data field\n- Set transaction 'to' to the token contract address\n- Set transaction 'value' to 0 (not sending BNB)\n- After transfer, the sender's token balance should be 0 or very close to 0\n- The recipient's token balance should increase by the transfer amount", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "transfer", "max", "balance", "query", "intermediate"], "parameter_names": ["to_address", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"recipient\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\", \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\"], \"comment\": \"USDT and CAKE on BSC Mainnet\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"from_list\", \"values\": [18, 18]}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for natural language\", \"generation\": {\"method\": \"from_list\", \"values\": [\"USDT\", \"CAKE\"]}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct token contract\", \"expected\": \"{token_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct transfer function signature\", \"expected\": \"transfer(address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.1}, {\"description\": \"Transferred entire balance\", \"tolerance\": \"0.1%\", \"type\": \"max_amount_transferred\", \"weight\": 0.2}, {\"description\": \"Sender token balance should be 0 or very close to 0 after transfer\", \"max_remaining\": \"0.01 tokens\", \"type\": \"sender_balance_zero\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must have some token balance\", \"min_balance\": \"1 tokens\", \"token\": \"{token_address}\", \"type\": \"token_balance\"}, {\"address\": \"{token_address}\", \"description\": \"Token contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"ERC20\", \"note\": \"Agent must have tokens to transfer\", \"required_functions\": [\"transfer\", \"balanceOf\"]}, \"estimated_gas\": 65000, \"requires_balance_query\": true, \"requires_contract\": true, \"requires_token_balance\": true, \"tags\": [\"erc20\", \"transfer\", \"max\", \"balance\", \"query\", \"intermediate\"]}", "source_path": "basic_transactions/erc20_operations/erc20_transfer_max_amount.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"erc20_transfer_max_amount\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"ERC20\", \"note\": \"Agent must have tokens to transfer\", \"required_functions\": [\"transfer\", \"balanceOf\"]}, \"estimated_gas\": 65000, \"requires_balance_query\": true, \"requires_contract\": true, \"requires_token_balance\": true, \"tags\": [\"erc20\", \"transfer\", \"max\", \"balance\", \"query\", \"intermediate\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"recipient\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\", \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\"], \"comment\": \"USDT and CAKE on BSC Mainnet\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"from_list\", \"values\": [18, 18]}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for natural language\", \"generation\": {\"method\": \"from_list\", \"values\": [\"USDT\", \"CAKE\"]}, \"role\": \"parameter\", \"type\": \"string\"}}, \"subcategory\": \"erc20_operations\", \"title\": \"ERC20 Transfer Maximum Amount\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct token contract\", \"expected\": \"{token_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct transfer function signature\", \"expected\": \"transfer(address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.1}, {\"description\": \"Transferred entire balance\", \"tolerance\": \"0.1%\", \"type\": \"max_amount_transferred\", \"weight\": 0.2}, {\"description\": \"Sender token balance should be 0 or very close to 0 after transfer\", \"max_remaining\": \"0.01 tokens\", \"type\": \"sender_balance_zero\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must have some token balance\", \"min_balance\": \"1 tokens\", \"token\": \"{token_address}\", \"type\": \"token_balance\"}, {\"address\": \"{token_address}\", \"description\": \"Token contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc20_transfer_percentage", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "medium", "title": "ERC20 Percentage Token Transfer", "description": "Transfer a percentage of ERC20 token balance from the agent's address to another address.\n\nTechnical context:\n- Requires querying the agent's current token balance before calculating transfer amount\n- Formula: transfer_amount = token_balance * (percentage / 100)\n- Use the token contract's balanceOf(address) function to query balance\n- The transfer function signature: transfer(address to, uint256 amount)\n- Recommended gas limit: 65000\n\nKey considerations:\n- Create a Contract instance with the token address and ERC20 ABI\n- Call balanceOf(agentAddress) to get current token balance\n- Calculate percentage of the balance (in smallest unit)\n- Encode the transfer function call with calculated amount\n- The transaction 'to' field should be the token contract address\n- The transaction 'value' should be 0 (not sending native BNB)", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "token", "percentage", "contract_call", "balance_query", "intermediate"], "parameter_names": ["percentage", "to_address", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"percentage\": {\"description\": \"Percentage of token balance to transfer (10-90)\", \"generation\": {\"max\": 90, \"min\": 10, \"step\": 5}, \"role\": \"parameter\", \"type\": \"integer\", \"unit\": \"%\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"BSC Mainnet USDT\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"from_list\", \"values\": [\"USDT\"]}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls the correct token contract\", \"expected\": \"{token_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct ERC20 transfer function signature\", \"expected\": \"transfer(address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.1}, {\"description\": \"Token balance changed by correct percentage\", \"receiver_change\": \"+{amount}\", \"sender_change\": \"-{percentage}%\", \"tolerance\": \"2%\", \"type\": \"percentage_token_balance_change\", \"weight\": 0.3}, {\"description\": \"Agent queried balance before transfer\", \"note\": \"This checks if the transfer amount matches percentage of initial balance\", \"type\": \"balance_query\", \"weight\": 0.1}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient token balance\", \"min_balance\": \"200 tokens\", \"type\": \"token_balance\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"required_functions\": [\"transfer\", \"balanceOf\"], \"standard\": \"ERC20\"}, \"estimated_gas\": 65000, \"requires_balance_query\": true, \"requires_contract\": true, \"requires_token_balance\": true, \"tags\": [\"erc20\", \"token\", \"percentage\", \"contract_call\", \"balance_query\", \"intermediate\"]}", "source_path": "basic_transactions/erc20_operations/erc20_transfer_percentage.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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)\"], \"difficulty\": \"medium\", \"id\": \"erc20_transfer_percentage\", \"metadata\": {\"contract_requirements\": {\"required_functions\": [\"transfer\", \"balanceOf\"], \"standard\": \"ERC20\"}, \"estimated_gas\": 65000, \"requires_balance_query\": true, \"requires_contract\": true, \"requires_token_balance\": true, \"tags\": [\"erc20\", \"token\", \"percentage\", \"contract_call\", \"balance_query\", \"intermediate\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"percentage\": {\"description\": \"Percentage of token balance to transfer (10-90)\", \"generation\": {\"max\": 90, \"min\": 10, \"step\": 5}, \"role\": \"parameter\", \"type\": \"integer\", \"unit\": \"%\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"BSC Mainnet USDT\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"from_list\", \"values\": [\"USDT\"]}, \"role\": \"parameter\", \"type\": \"string\"}}, \"subcategory\": \"erc20_operations\", \"title\": \"ERC20 Percentage Token Transfer\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls the correct token contract\", \"expected\": \"{token_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct ERC20 transfer function signature\", \"expected\": \"transfer(address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.1}, {\"description\": \"Token balance changed by correct percentage\", \"receiver_change\": \"+{amount}\", \"sender_change\": \"-{percentage}%\", \"tolerance\": \"2%\", \"type\": \"percentage_token_balance_change\", \"weight\": 0.3}, {\"description\": \"Agent queried balance before transfer\", \"note\": \"This checks if the transfer amount matches percentage of initial balance\", \"type\": \"balance_query\", \"weight\": 0.1}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient token balance\", \"min_balance\": \"200 tokens\", \"type\": \"token_balance\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc20_transfer_with_callback_1363", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "medium", "title": "ERC1363 Transfer with Callback", "description": "Transfer ERC1363 tokens to a receiver contract with automatic callback execution.\n\nTechnical context:\n- Use ERC1363's transferAndCall(address to, uint256 value) function\n- This is an extension of ERC20 that calls onTransferReceived() on the receiver\n- The receiver must implement IERC1363Receiver interface\n- Function selector: 0x4000aea0\n- Parameters: to (address, 32 bytes) + value (uint256, 32 bytes)\n- More gas-efficient than approve + transferFrom pattern\n- The callback onTransferReceived(address,address,uint256,bytes) will be triggered\n- Commonly used for paying for services in one transaction\n- Recommended gas limit: 200000 (includes callback execution)", "natural_language_templates": ["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"], "chain": "BSC", "network": "mainnet", "tags": ["erc1363", "token", "transfer", "callback", "receiver_pays", "onchain"], "parameter_names": ["amount", "to_address", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"amount\": {\"description\": \"Amount of tokens to transfer\", \"generation\": {\"decimals\": 2, \"max\": 50, \"method\": \"random\", \"min\": 1}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"to_address\": {\"description\": \"Receiver contract address (must implement IERC1363Receiver)\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC1363 token contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC1363 token from environment\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"token_contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"number\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"display\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"address\": \"agent\", \"description\": \"Sender token balance decreased correctly\", \"expected_change\": \"-{amount}\", \"tolerance\": \"0\", \"type\": \"token_balance_change\", \"weight\": 0.4}, {\"address\": \"{to_address}\", \"description\": \"Receiver token balance increased correctly\", \"expected_change\": \"+{amount}\", \"tolerance\": \"0\", \"type\": \"token_balance_change\", \"weight\": 0.2}, {\"description\": \"Correct function selector for transferAndCall\", \"expected_selector\": \"0x4000aea0\", \"type\": \"function_selector\", \"weight\": 0.1}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient token balance\", \"min_balance\": \"{amount}\", \"type\": \"token_balance\"}, {\"description\": \"Agent must have sufficient BNB for gas\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"erc_standard\": \"ERC1363\", \"estimated_gas\": 200000, \"implementation_status\": \"partial\", \"known_limitations\": [\"Most standard ERC20 tokens (USDT, USDC, DAI) do NOT support ERC1363\", \"Requires token to implement transferAndCall function\", \"Requires receiver to implement IERC1363Receiver interface\", \"For testing, need to deploy a custom ERC1363-compliant token\"], \"network\": \"mainnet\", \"requires_contract\": true, \"requires_custom_token\": true, \"tags\": [\"erc1363\", \"token\", \"transfer\", \"callback\", \"receiver_pays\", \"onchain\"]}", "source_path": "basic_transactions/erc20_operations/erc20_transfer_with_callback_1363.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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)\"], \"difficulty\": \"medium\", \"id\": \"erc20_transfer_with_callback_1363\", \"metadata\": {\"erc_standard\": \"ERC1363\", \"estimated_gas\": 200000, \"implementation_status\": \"partial\", \"known_limitations\": [\"Most standard ERC20 tokens (USDT, USDC, DAI) do NOT support ERC1363\", \"Requires token to implement transferAndCall function\", \"Requires receiver to implement IERC1363Receiver interface\", \"For testing, need to deploy a custom ERC1363-compliant token\"], \"network\": \"mainnet\", \"requires_contract\": true, \"requires_custom_token\": true, \"tags\": [\"erc1363\", \"token\", \"transfer\", \"callback\", \"receiver_pays\", \"onchain\"]}, \"natural_language_templates\": [\"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\"], \"parameters\": {\"amount\": {\"description\": \"Amount of tokens to transfer\", \"generation\": {\"decimals\": 2, \"max\": 50, \"method\": \"random\", \"min\": 1}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"to_address\": {\"description\": \"Receiver contract address (must implement IERC1363Receiver)\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC1363 token contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC1363 token from environment\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"token_contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"number\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"display\", \"type\": \"string\"}}, \"subcategory\": \"erc20_operations\", \"title\": \"ERC1363 Transfer with Callback\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"address\": \"agent\", \"description\": \"Sender token balance decreased correctly\", \"expected_change\": \"-{amount}\", \"tolerance\": \"0\", \"type\": \"token_balance_change\", \"weight\": 0.4}, {\"address\": \"{to_address}\", \"description\": \"Receiver token balance increased correctly\", \"expected_change\": \"+{amount}\", \"tolerance\": \"0\", \"type\": \"token_balance_change\", \"weight\": 0.2}, {\"description\": \"Correct function selector for transferAndCall\", \"expected_selector\": \"0x4000aea0\", \"type\": \"function_selector\", \"weight\": 0.1}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient token balance\", \"min_balance\": \"{amount}\", \"type\": \"token_balance\"}, {\"description\": \"Agent must have sufficient BNB for gas\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc20_transferfrom_basic", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "erc20_operations", "difficulty": "medium", "title": "ERC20 TransferFrom - Authorized Transfer", "description": "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.\n\nIMPORTANT: Authorization Pattern\n- The from_address (token owner) has already approved you (agent) to spend tokens\n- You need to call transferFrom(from, to, amount) to execute the transfer\n- This is different from transfer() which only moves your own tokens\n\nTechnical context:\n- ERC20 transferFrom function signature: transferFrom(address from, address to, uint256 amount)\n- Three addresses involved:\n 1. from_address: Token owner (source of tokens)\n 2. agent_address: Approved spender (you, executing the transfer)\n 3. to_address: Recipient (destination of tokens)\n- The agent must be approved by the owner beforehand (already done in test environment)\n- The allowance will be decreased by the transfer amount\n\nFunction call construction:\n```typescript\nconst ERC20_ABI = ['function transferFrom(address from, address to, uint256 amount) external returns (bool)'];\nconst tokenContract = new Contract interface(token_address, ERC20_ABI, provider);\nconst amountWei = ethers.parseUnits(amount.toString(), token_decimals);\nconst data = tokenContract.interface.encodeFunctionData('transferFrom', [from_address, to_address, amountWei]);\n```\n\nKey considerations:\n- Parameter order: from, to, amount (NOT to, amount like transfer())\n- Check allowance before attempting transfer\n- Convert amount to wei using token decimals\n- Transaction 'to' field should be the token contract address\n- Transaction 'value' should be 0 (not sending native BNB)\n\nCommon mistakes to avoid:\n- DO NOT confuse with transfer(to, amount) - this is transferFrom(from, to, amount)\n- DO NOT swap the order of from and to addresses\n- DO ensure sufficient allowance exists\n- DO convert amount to proper decimal representation", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "transferfrom", "approval", "authorization", "token"], "parameter_names": ["agent_address", "amount", "chain_id", "from_address", "to_address", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"agent_address\": {\"description\": \"Agent address (approved spender)\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"amount\": {\"description\": \"Transfer amount in tokens\", \"example\": 50.0, \"generation\": {\"decimals\": 2, \"max\": 100.0, \"method\": \"random\", \"min\": 10.0}, \"range\": [10.0, 100.0], \"role\": \"transfer_amount\", \"type\": \"number\"}, \"chain_id\": {\"description\": \"Blockchain network ID (56 for BSC Mainnet)\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"from_address\": {\"description\": \"Token owner address (has approved agent)\", \"dynamic\": true, \"generation\": {\"env_key\": \"rich_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address (USDT)\", \"example\": \"0x55d398326f99059fF775485246999027B3197955\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals\", \"example\": 18, \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"example\": \"USDT\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{}", "source_path": "basic_transactions/erc20_operations/erc20_transferfrom_basic.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"contracts\": {\"usdt_token\": {\"abi_functions\": [\"function transferFrom(address from, address to, uint256 amount) external returns (bool)\", \"function allowance(address owner, address spender) external view returns (uint256)\", \"function balanceOf(address account) external view returns (uint256)\"], \"address\": \"0x55d398326f99059fF775485246999027B3197955\", \"name\": \"Tether USD (USDT)\"}}, \"description\": [\"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\"], \"difficulty\": \"medium\", \"expected_behavior\": {\"gas_estimate\": 70000, \"state_changes\": [\"From address token balance decreases by amount\", \"To address token balance increases by amount\", \"Allowance decreases by amount\"], \"transaction_count\": 1}, \"hints\": [\"Use transferFrom(from, to, amount) - note the three parameters\", \"The from_address is the token owner, agent_address is you (the spender)\", \"Check allowance first: token.allowance(from_address, agent_address)\", \"Convert amount to wei: ethers.parseUnits(amount.toString(), 18)\", \"Transaction 'to' field should be the token contract address, not the recipient\"], \"id\": \"erc20_transferfrom_basic\", \"natural_language_templates\": [\"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}\"], \"parameters\": {\"agent_address\": {\"description\": \"Agent address (approved spender)\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"amount\": {\"description\": \"Transfer amount in tokens\", \"example\": 50.0, \"generation\": {\"decimals\": 2, \"max\": 100.0, \"method\": \"random\", \"min\": 10.0}, \"range\": [10.0, 100.0], \"role\": \"transfer_amount\", \"type\": \"number\"}, \"chain_id\": {\"description\": \"Blockchain network ID (56 for BSC Mainnet)\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"from_address\": {\"description\": \"Token owner address (has approved agent)\", \"dynamic\": true, \"generation\": {\"env_key\": \"rich_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address (USDT)\", \"example\": \"0x55d398326f99059fF775485246999027B3197955\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals\", \"example\": 18, \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"example\": \"USDT\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}, \"subcategory\": \"erc20_operations\", \"tags\": [\"erc20\", \"transferfrom\", \"approval\", \"authorization\", \"token\"], \"test_script_template\": \"erc20_transferfrom_basic.ts\", \"title\": \"ERC20 TransferFrom - Authorized Transfer\", \"validation_criteria\": {\"allowance_decrease\": {\"description\": \"Allowance decreased by transfer amount\", \"weight\": 20}, \"correct_function\": {\"description\": \"Called transferFrom with correct parameters\", \"weight\": 20}, \"from_balance_decrease\": {\"description\": \"From address balance decreased correctly\", \"weight\": 20}, \"to_balance_increase\": {\"description\": \"To address balance increased correctly\", \"weight\": 20}, \"transaction_success\": {\"description\": \"Transaction executed successfully without reverting\", \"weight\": 20}}, \"version\": \"2.0.0\"}"} {"id": "bnb_transfer_basic", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "native_transfer", "difficulty": "easy", "title": "Basic BNB Transfer", "description": "Transfer a fixed amount of BNB from one address to another.\n\nTechnical context:\n- This is a simple EOA (Externally Owned Account) to EOA transfer\n- Standard gas limit for simple transfers: 21000\n- Use EIP-1559 transaction format (type: 2)\n- Amount must be converted to Wei: amount_bnb × 10^18\n\nKey considerations:\n- Set transaction 'to' field to recipient address\n- Set transaction 'value' field to amount in Wei\n- Set appropriate gas parameters (maxFeePerGas, maxPriorityFeePerGas)\n- For simple transfers, data field can be '0x' or empty", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["native_transfer", "bnb", "basic", "simple"], "parameter_names": ["amount", "to_address"], "parameters": "{\"amount\": {\"description\": \"Transfer amount in BNB\", \"generation\": {\"decimals\": 3, \"max\": 0.1, \"method\": \"random\", \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Target address must be correct\", \"expected\": \"{to_address}\", \"field\": \"to\", \"type\": \"address_check\", \"weight\": 0.25}, {\"description\": \"Transfer amount must be correct\", \"expected\": \"{amount}\", \"field\": \"value\", \"tolerance\": 0.001, \"type\": \"value_check\", \"weight\": 0.25}, {\"address\": \"sender\", \"description\": \"Sender balance decreased by amount (plus gas)\", \"expected_change\": \"-{amount}\", \"tolerance_type\": \"gas_only\", \"type\": \"balance_change\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance (amount + gas)\", \"required\": \"{amount}\", \"type\": \"balance_check\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 21000, \"requires_contract\": false, \"tags\": [\"native_transfer\", \"bnb\", \"basic\", \"simple\"]}", "source_path": "basic_transactions/native_transfer/bnb_transfer_basic.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"easy\", \"id\": \"bnb_transfer_basic\", \"metadata\": {\"estimated_gas\": 21000, \"requires_contract\": false, \"tags\": [\"native_transfer\", \"bnb\", \"basic\", \"simple\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"amount\": {\"description\": \"Transfer amount in BNB\", \"generation\": {\"decimals\": 3, \"max\": 0.1, \"method\": \"random\", \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}}, \"subcategory\": \"native_transfer\", \"title\": \"Basic BNB Transfer\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Target address must be correct\", \"expected\": \"{to_address}\", \"field\": \"to\", \"type\": \"address_check\", \"weight\": 0.25}, {\"description\": \"Transfer amount must be correct\", \"expected\": \"{amount}\", \"field\": \"value\", \"tolerance\": 0.001, \"type\": \"value_check\", \"weight\": 0.25}, {\"address\": \"sender\", \"description\": \"Sender balance decreased by amount (plus gas)\", \"expected_change\": \"-{amount}\", \"tolerance_type\": \"gas_only\", \"type\": \"balance_change\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance (amount + gas)\", \"required\": \"{amount}\", \"type\": \"balance_check\"}]}, \"version\": \"2.0.0\"}"} {"id": "bnb_transfer_max_amount", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "native_transfer", "difficulty": "medium", "title": "BNB Transfer Maximum Amount", "description": "Transfer the maximum possible amount of BNB to an address, which is the current balance minus the gas cost for the transaction.\n\nTechnical context:\n- Query the current balance using eth_getBalance RPC call\n- Calculate the gas cost: gasLimit × gasPrice (or maxFeePerGas for EIP-1559)\n- The maximum transferable amount = balance - gas cost\n- This is a common pattern when users want to \"empty\" an address\n- Estimated gas for simple transfer: 21000\n\nKey considerations:\n- First query current balance\n- Calculate gas cost accurately to avoid insufficient balance error\n- For EIP-1559: gas cost = gasLimit × maxFeePerGas\n- Transfer amount = balance - estimated_gas_cost\n- Leave enough for gas, otherwise the transaction will fail", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["bnb", "native", "transfer", "max", "balance", "query", "intermediate"], "parameter_names": ["to_address"], "parameters": "{\"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"recipient\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Correct recipient address\", \"expected\": \"{to_address}\", \"type\": \"recipient_correct\", \"weight\": 0.2}, {\"description\": \"Transferred maximum amount (balance - gas)\", \"tolerance\": \"0.1%\", \"type\": \"max_amount_transferred\", \"weight\": 0.3}, {\"description\": \"Sender balance should be close to 0 (only dust remaining)\", \"max_remaining\": \"0.0001 BNB\", \"type\": \"sender_balance_minimal\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 21000, \"requires_balance_query\": true, \"requires_contract\": false, \"requires_gas_calculation\": true, \"tags\": [\"bnb\", \"native\", \"transfer\", \"max\", \"balance\", \"query\", \"intermediate\"]}", "source_path": "basic_transactions/native_transfer/bnb_transfer_max_amount.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"bnb_transfer_max_amount\", \"metadata\": {\"estimated_gas\": 21000, \"requires_balance_query\": true, \"requires_contract\": false, \"requires_gas_calculation\": true, \"tags\": [\"bnb\", \"native\", \"transfer\", \"max\", \"balance\", \"query\", \"intermediate\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"recipient\", \"type\": \"address\"}}, \"subcategory\": \"native_transfer\", \"title\": \"BNB Transfer Maximum Amount\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Correct recipient address\", \"expected\": \"{to_address}\", \"type\": \"recipient_correct\", \"weight\": 0.2}, {\"description\": \"Transferred maximum amount (balance - gas)\", \"tolerance\": \"0.1%\", \"type\": \"max_amount_transferred\", \"weight\": 0.3}, {\"description\": \"Sender balance should be close to 0 (only dust remaining)\", \"max_remaining\": \"0.0001 BNB\", \"type\": \"sender_balance_minimal\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance\"}]}, \"version\": \"2.0.0\"}"} {"id": "bnb_transfer_percentage", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "native_transfer", "difficulty": "medium", "title": "Percentage BNB Transfer", "description": "Transfer a percentage of BNB balance from sender's address to another address.\n\nTechnical context:\n- Requires querying the sender's current balance before calculating transfer amount\n- Formula: transfer_amount = balance × (percentage / 100)\n- Query balance using eth_getBalance RPC call\n- Standard gas limit: 21000\n\nKey considerations:\n- First query current balance\n- Calculate transfer amount based on percentage\n- Convert amount to Wei: calculated_amount × 10^18\n- Set transaction 'to' field to recipient address\n- Set transaction 'value' field to calculated amount in Wei", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["native_transfer", "bnb", "percentage", "query", "dynamic"], "parameter_names": ["percentage", "to_address"], "parameters": "{\"percentage\": {\"description\": \"Percentage of balance to transfer (1-100)\", \"generation\": {\"max\": 90, \"method\": \"random\", \"min\": 10, \"step\": 5}, \"role\": \"percentage\", \"type\": \"integer\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Target address must be correct\", \"expected\": \"{to_address}\", \"field\": \"to\", \"type\": \"address_check\", \"weight\": 0.2}, {\"base\": \"sender_balance_before\", \"description\": \"Transfer amount must be correct percentage of balance\", \"field\": \"value\", \"percentage\": \"{percentage}\", \"tolerance\": 0.02, \"type\": \"percentage_value_check\", \"weight\": 0.3}, {\"address\": \"sender\", \"description\": \"Balance change must match the percentage (plus gas)\", \"expected_percentage\": \"-{percentage}\", \"tolerance\": 0.02, \"tolerance_type\": \"percentage\", \"type\": \"balance_percentage_change\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Sender must have at least 0.01 BNB\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance_check\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 21000, \"requires_contract\": false, \"requires_query\": true, \"tags\": [\"native_transfer\", \"bnb\", \"percentage\", \"query\", \"dynamic\"]}", "source_path": "basic_transactions/native_transfer/bnb_transfer_percentage.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"bnb_transfer_percentage\", \"metadata\": {\"estimated_gas\": 21000, \"requires_contract\": false, \"requires_query\": true, \"tags\": [\"native_transfer\", \"bnb\", \"percentage\", \"query\", \"dynamic\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"percentage\": {\"description\": \"Percentage of balance to transfer (1-100)\", \"generation\": {\"max\": 90, \"method\": \"random\", \"min\": 10, \"step\": 5}, \"role\": \"percentage\", \"type\": \"integer\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}}, \"subcategory\": \"native_transfer\", \"title\": \"Percentage BNB Transfer\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Target address must be correct\", \"expected\": \"{to_address}\", \"field\": \"to\", \"type\": \"address_check\", \"weight\": 0.2}, {\"base\": \"sender_balance_before\", \"description\": \"Transfer amount must be correct percentage of balance\", \"field\": \"value\", \"percentage\": \"{percentage}\", \"tolerance\": 0.02, \"type\": \"percentage_value_check\", \"weight\": 0.3}, {\"address\": \"sender\", \"description\": \"Balance change must match the percentage (plus gas)\", \"expected_percentage\": \"-{percentage}\", \"tolerance\": 0.02, \"tolerance_type\": \"percentage\", \"type\": \"balance_percentage_change\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Sender must have at least 0.01 BNB\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance_check\"}]}, \"version\": \"2.0.0\"}"} {"id": "bnb_transfer_to_contract", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "native_transfer", "difficulty": "easy", "title": "BNB Transfer to Contract", "description": "Test the agent's ability to transfer BNB to a smart contract address.\n\nTechnical context:\n- The target is a WBNB (Wrapped BNB) contract that accepts BNB transfers\n- WBNB has a receive() function that calls deposit() internally\n- This requires more gas than a simple transfer due to storage writes and event emissions\n- Recommended gasLimit: 60000 or higher (vs 21000 for EOA transfers)\n\nKey considerations:\n- Verify the target address is a contract before sending\n- Set appropriate gas limit for contract interaction\n- Use standard EIP-1559 transaction format", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["native_transfer", "bnb", "contract", "payable", "basic", "wbnb"], "parameter_names": ["amount", "contract_address"], "parameters": "{\"amount\": {\"description\": \"Transfer amount in BNB\", \"generation\": {\"decimals\": 3, \"max\": 0.05, \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"contract_address\": {\"description\": \"Target contract address (must be a contract, not EOA)\", \"generation\": {\"addresses\": [\"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"], \"comment\": \"BSC Mainnet WBNB - guaranteed to accept BNB transfers via receive() function\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Correct amount of BNB transferred\", \"expected\": \"{amount}\", \"tolerance\": \"0\", \"type\": \"value_transfer\", \"weight\": 0.3}, {\"description\": \"BNB sent to correct contract address\", \"expected\": \"{contract_address}\", \"type\": \"recipient_check\", \"weight\": 0.2}, {\"description\": \"Contract balance increased correctly\", \"expected_change\": \"+{amount}\", \"tolerance\": \"0\", \"type\": \"contract_balance_change\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance\", \"min_balance\": \"0.2 BNB\", \"type\": \"balance\"}, {\"address\": \"{contract_address}\", \"description\": \"Target address must be a contract\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"must_accept_bnb\": true, \"must_be_payable\": true, \"note\": \"WBNB deposit requires ~50-60k gas for storage write and event emission\"}, \"estimated_gas\": 60000, \"requires_contract\": true, \"tags\": [\"native_transfer\", \"bnb\", \"contract\", \"payable\", \"basic\", \"wbnb\"]}", "source_path": "basic_transactions/native_transfer/bnb_transfer_to_contract.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"easy\", \"id\": \"bnb_transfer_to_contract\", \"metadata\": {\"contract_requirements\": {\"must_accept_bnb\": true, \"must_be_payable\": true, \"note\": \"WBNB deposit requires ~50-60k gas for storage write and event emission\"}, \"estimated_gas\": 60000, \"requires_contract\": true, \"tags\": [\"native_transfer\", \"bnb\", \"contract\", \"payable\", \"basic\", \"wbnb\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"amount\": {\"description\": \"Transfer amount in BNB\", \"generation\": {\"decimals\": 3, \"max\": 0.05, \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"contract_address\": {\"description\": \"Target contract address (must be a contract, not EOA)\", \"generation\": {\"addresses\": [\"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"], \"comment\": \"BSC Mainnet WBNB - guaranteed to accept BNB transfers via receive() function\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}}, \"subcategory\": \"native_transfer\", \"title\": \"BNB Transfer to Contract\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Correct amount of BNB transferred\", \"expected\": \"{amount}\", \"tolerance\": \"0\", \"type\": \"value_transfer\", \"weight\": 0.3}, {\"description\": \"BNB sent to correct contract address\", \"expected\": \"{contract_address}\", \"type\": \"recipient_check\", \"weight\": 0.2}, {\"description\": \"Contract balance increased correctly\", \"expected_change\": \"+{amount}\", \"tolerance\": \"0\", \"type\": \"contract_balance_change\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance\", \"min_balance\": \"0.2 BNB\", \"type\": \"balance\"}, {\"address\": \"{contract_address}\", \"description\": \"Target address must be a contract\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "bnb_transfer_with_message", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "native_transfer", "difficulty": "easy", "title": "BNB Transfer with Message", "description": "Transfer BNB with an attached text message encoded in the transaction data field.\n\nTechnical context:\n- Message should be encoded in the 'data' field of the transaction\n- Convert string to UTF-8 bytes, then to hexadecimal format\n- Transactions with data field consume slightly more gas than empty data\n- Recommended gas limit: 25000 (vs 21000 for transfers without data)\n\nKey considerations:\n- Encode message as UTF-8 bytes in hex format\n- Set transaction 'to' field to recipient address\n- Set transaction 'value' field to transfer amount\n- Set transaction 'data' field to hex-encoded message", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["native_transfer", "bnb", "message", "data_field", "basic"], "parameter_names": ["amount", "message", "to_address"], "parameters": "{\"amount\": {\"description\": \"Transfer amount in BNB\", \"generation\": {\"decimals\": 3, \"max\": 0.1, \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"message\": {\"description\": \"Text message to attach to the transaction\", \"generation\": {\"charset\": \"alphanumeric_space\", \"length\": 20, \"method\": \"random\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.2}, {\"description\": \"Correct amount of BNB transferred\", \"expected\": \"{amount}\", \"tolerance\": \"0\", \"type\": \"value_transfer\", \"weight\": 0.2}, {\"description\": \"BNB sent to correct recipient\", \"expected\": \"{to_address}\", \"type\": \"recipient_check\", \"weight\": 0.2}, {\"description\": \"Transaction data contains the message\", \"expected\": \"{message}\", \"type\": \"message_check\", \"weight\": 0.3}, {\"description\": \"Sender balance decreased correctly\", \"expected_change\": \"-{amount}\", \"tolerance\": \"0.01 BNB\", \"type\": \"balance_change\", \"weight\": 0.1}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance\", \"min_balance\": \"0.2 BNB\", \"type\": \"balance\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 25000, \"requires_contract\": false, \"tags\": [\"native_transfer\", \"bnb\", \"message\", \"data_field\", \"basic\"]}", "source_path": "basic_transactions/native_transfer/bnb_transfer_with_message.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"easy\", \"id\": \"bnb_transfer_with_message\", \"metadata\": {\"estimated_gas\": 25000, \"requires_contract\": false, \"tags\": [\"native_transfer\", \"bnb\", \"message\", \"data_field\", \"basic\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"amount\": {\"description\": \"Transfer amount in BNB\", \"generation\": {\"decimals\": 3, \"max\": 0.1, \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"message\": {\"description\": \"Text message to attach to the transaction\", \"generation\": {\"charset\": \"alphanumeric_space\", \"length\": 20, \"method\": \"random\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}}, \"subcategory\": \"native_transfer\", \"title\": \"BNB Transfer with Message\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.2}, {\"description\": \"Correct amount of BNB transferred\", \"expected\": \"{amount}\", \"tolerance\": \"0\", \"type\": \"value_transfer\", \"weight\": 0.2}, {\"description\": \"BNB sent to correct recipient\", \"expected\": \"{to_address}\", \"type\": \"recipient_check\", \"weight\": 0.2}, {\"description\": \"Transaction data contains the message\", \"expected\": \"{message}\", \"type\": \"message_check\", \"weight\": 0.3}, {\"description\": \"Sender balance decreased correctly\", \"expected_change\": \"-{amount}\", \"tolerance\": \"0.01 BNB\", \"type\": \"balance_change\", \"weight\": 0.1}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance\", \"min_balance\": \"0.2 BNB\", \"type\": \"balance\"}]}, \"version\": \"2.0.0\"}"} {"id": "wbnb_deposit", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "native_transfer", "difficulty": "medium", "title": "WBNB Deposit (Wrap BNB)", "description": "Deposit native BNB into the WBNB (Wrapped BNB) contract to receive an equivalent amount of WBNB tokens.\n\nTechnical context:\n- WBNB is an ERC20 wrapper for native BNB, allowing BNB to be used in DeFi protocols\n- The deposit() function is payable and mints WBNB tokens equal to msg.value\n- Function signature: deposit() payable\n- This requires calling a contract function, not just sending BNB\n- Recommended gas limit: 60000\n\nKey considerations:\n- Call the deposit() function on WBNB contract\n- Encode function call: deposit() has no parameters\n- Function selector: 0xd0e30db0\n- Set transaction 'to' to the WBNB contract address\n- Set transaction 'value' to the amount of BNB to deposit\n- After deposit, WBNB token balance increases by the deposit amount\n- Native BNB balance decreases by the deposit amount (plus gas)", "natural_language_templates": ["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"], "chain": "BSC", "network": "mainnet", "tags": ["wbnb", "wrap", "deposit", "native_token", "contract_call", "intermediate"], "parameter_names": ["amount", "wbnb_address"], "parameters": "{\"amount\": {\"description\": \"Amount of BNB to deposit\", \"generation\": {\"decimals\": 3, \"max\": 0.05, \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"wbnb_address\": {\"description\": \"WBNB contract address\", \"generation\": {\"addresses\": [\"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"], \"comment\": \"BSC Mainnet WBNB contract\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls WBNB contract\", \"expected\": \"{wbnb_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct deposit function signature\", \"expected\": \"deposit()\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"WBNB token balance increased by deposit amount\", \"expected_increase\": \"{amount}\", \"type\": \"wbnb_balance_increase\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance\", \"min_balance\": \"0.2 BNB\", \"type\": \"balance\"}, {\"address\": \"{wbnb_address}\", \"description\": \"WBNB contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"WBNB\", \"note\": \"WBNB is a specific contract that wraps native BNB into an ERC20 token\", \"required_functions\": [\"deposit\", \"balanceOf\"]}, \"estimated_gas\": 60000, \"requires_contract\": true, \"tags\": [\"wbnb\", \"wrap\", \"deposit\", \"native_token\", \"contract_call\", \"intermediate\"]}", "source_path": "basic_transactions/native_transfer/wbnb_deposit.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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)\"], \"difficulty\": \"medium\", \"id\": \"wbnb_deposit\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"WBNB\", \"note\": \"WBNB is a specific contract that wraps native BNB into an ERC20 token\", \"required_functions\": [\"deposit\", \"balanceOf\"]}, \"estimated_gas\": 60000, \"requires_contract\": true, \"tags\": [\"wbnb\", \"wrap\", \"deposit\", \"native_token\", \"contract_call\", \"intermediate\"]}, \"natural_language_templates\": [\"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\"], \"parameters\": {\"amount\": {\"description\": \"Amount of BNB to deposit\", \"generation\": {\"decimals\": 3, \"max\": 0.05, \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"wbnb_address\": {\"description\": \"WBNB contract address\", \"generation\": {\"addresses\": [\"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"], \"comment\": \"BSC Mainnet WBNB contract\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}}, \"subcategory\": \"native_transfer\", \"title\": \"WBNB Deposit (Wrap BNB)\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls WBNB contract\", \"expected\": \"{wbnb_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct deposit function signature\", \"expected\": \"deposit()\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"WBNB token balance increased by deposit amount\", \"expected_increase\": \"{amount}\", \"type\": \"wbnb_balance_increase\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance\", \"min_balance\": \"0.2 BNB\", \"type\": \"balance\"}, {\"address\": \"{wbnb_address}\", \"description\": \"WBNB contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "wbnb_withdraw", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "native_transfer", "difficulty": "medium", "title": "WBNB Withdraw (Unwrap WBNB)", "description": "Withdraw WBNB tokens from the WBNB contract to receive an equivalent amount of native BNB.\n\nTechnical context:\n- The withdraw(uint256) function burns WBNB tokens and sends native BNB back\n- Function signature: withdraw(uint256 wad)\n- The amount must be in wei (smallest unit)\n- You must have sufficient WBNB balance before withdrawal\n- Recommended gas limit: 60000\n\nKey considerations:\n- Call the withdraw(uint256) function on WBNB contract\n- Encode function call with amount parameter in wei\n- Function selector: 0x2e1a7d4d\n- Set transaction 'to' to the WBNB contract address\n- Set transaction 'value' to 0 (not sending BNB, just calling contract)\n- After withdrawal, WBNB token balance decreases\n- Native BNB balance increases by the withdrawal amount (minus gas)", "natural_language_templates": ["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"], "chain": "BSC", "network": "mainnet", "tags": ["wbnb", "unwrap", "withdraw", "native_token", "contract_call", "intermediate"], "parameter_names": ["amount", "wbnb_address"], "parameters": "{\"amount\": {\"description\": \"Amount of WBNB to withdraw (will be converted to BNB)\", \"generation\": {\"decimals\": 3, \"max\": 0.05, \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"WBNB\"}, \"wbnb_address\": {\"description\": \"WBNB contract address\", \"generation\": {\"addresses\": [\"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"], \"comment\": \"BSC Mainnet WBNB contract\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls WBNB contract\", \"expected\": \"{wbnb_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct withdraw function signature\", \"expected\": \"withdraw(uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"WBNB token balance decreased by withdrawal amount\", \"expected_decrease\": \"{amount}\", \"type\": \"wbnb_balance_decrease\", \"weight\": 0.15}, {\"description\": \"Native BNB balance increased by withdrawal amount (minus gas)\", \"expected_increase\": \"{amount}\", \"type\": \"bnb_balance_increase\", \"weight\": 0.15}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient WBNB balance\", \"min_balance\": \"200 WBNB\", \"type\": \"wbnb_balance\"}, {\"address\": \"{wbnb_address}\", \"description\": \"WBNB contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"WBNB\", \"note\": \"Must have WBNB tokens to withdraw\", \"required_functions\": [\"withdraw\", \"balanceOf\"]}, \"estimated_gas\": 60000, \"requires_contract\": true, \"requires_token_balance\": true, \"tags\": [\"wbnb\", \"unwrap\", \"withdraw\", \"native_token\", \"contract_call\", \"intermediate\"]}", "source_path": "basic_transactions/native_transfer/wbnb_withdraw.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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)\"], \"difficulty\": \"medium\", \"id\": \"wbnb_withdraw\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"WBNB\", \"note\": \"Must have WBNB tokens to withdraw\", \"required_functions\": [\"withdraw\", \"balanceOf\"]}, \"estimated_gas\": 60000, \"requires_contract\": true, \"requires_token_balance\": true, \"tags\": [\"wbnb\", \"unwrap\", \"withdraw\", \"native_token\", \"contract_call\", \"intermediate\"]}, \"natural_language_templates\": [\"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\"], \"parameters\": {\"amount\": {\"description\": \"Amount of WBNB to withdraw (will be converted to BNB)\", \"generation\": {\"decimals\": 3, \"max\": 0.05, \"min\": 0.001}, \"role\": \"transfer_amount\", \"type\": \"number\", \"unit\": \"WBNB\"}, \"wbnb_address\": {\"description\": \"WBNB contract address\", \"generation\": {\"addresses\": [\"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"], \"comment\": \"BSC Mainnet WBNB contract\", \"method\": \"from_list\"}, \"role\": \"contract\", \"type\": \"address\"}}, \"subcategory\": \"native_transfer\", \"title\": \"WBNB Withdraw (Unwrap WBNB)\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls WBNB contract\", \"expected\": \"{wbnb_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct withdraw function signature\", \"expected\": \"withdraw(uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"WBNB token balance decreased by withdrawal amount\", \"expected_decrease\": \"{amount}\", \"type\": \"wbnb_balance_decrease\", \"weight\": 0.15}, {\"description\": \"Native BNB balance increased by withdrawal amount (minus gas)\", \"expected_increase\": \"{amount}\", \"type\": \"bnb_balance_increase\", \"weight\": 0.15}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient WBNB balance\", \"min_balance\": \"200 WBNB\", \"type\": \"wbnb_balance\"}, {\"address\": \"{wbnb_address}\", \"description\": \"WBNB contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc1155_safe_transfer_with_data", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "nft_operations", "difficulty": "medium", "title": "ERC1155 Safe Transfer with Data", "description": "Transfer ERC1155 tokens with additional data bytes using the safeTransferFrom function.\n\nTechnical context:\n- ERC1155 is the multi-token standard supporting both fungible and non-fungible tokens\n- Function signature: safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)\n- The 'data' parameter allows passing arbitrary bytes to the recipient\n- If 'to' is a contract, it must implement ERC1155TokenReceiver interface\n- The receiver's onERC1155Received function will be called with the data\n- The 'from' address must be the current owner or approved operator\n- Recommended gas limit: 200000\n\nKey considerations:\n- Create a Contract instance with ERC1155 address and ERC1155 ABI\n- Use encode the function call('safeTransferFrom', [from, to, id, amount, data])\n- The 'data' parameter should be properly encoded bytes (e.g., using ethers.toUtf8Bytes)\n- Set transaction 'to' to the ERC1155 contract address\n- Set transaction 'value' to 0 (not sending BNB)\n- After transfer, balanceOf(to, id) should increase by amount\n- The agent's balance balanceOf(from, id) should decrease by amount", "natural_language_templates": ["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"], "chain": "BSC", "network": "mainnet", "tags": ["erc1155", "multi-token", "nft", "transfer", "data", "callback", "advanced"], "parameter_names": ["amount", "data_message", "nft_address", "nft_name", "to_address", "token_id"], "parameters": "{\"amount\": {\"description\": \"Amount of tokens to transfer\", \"generation\": {\"method\": \"fixed\", \"value\": 5}, \"role\": \"transfer_amount\", \"type\": \"integer\"}, \"data_message\": {\"description\": \"Custom data message to include with transfer\", \"generation\": {\"method\": \"from_list\", \"values\": [\"Transfer with metadata\", \"NFT batch transfer\", \"Game item transfer\", \"Token migration\"]}, \"role\": \"parameter\", \"type\": \"string\"}, \"nft_address\": {\"description\": \"ERC1155 multi-token contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC1155 token from environment\", \"env_key\": \"erc1155_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"Multi-token collection name for natural language\", \"generation\": {\"method\": \"fixed\", \"value\": \"TestMultiToken\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"recipient\", \"type\": \"address\"}, \"token_id\": {\"description\": \"Token ID to transfer (token type within the collection)\", \"generation\": {\"method\": \"fixed\", \"value\": 1}, \"role\": \"parameter\", \"type\": \"integer\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.25}, {\"description\": \"Transaction calls correct ERC1155 contract\", \"expected\": \"{nft_address}\", \"type\": \"contract_call\", \"weight\": 0.15}, {\"description\": \"Correct safeTransferFrom function signature\", \"expected\": \"safeTransferFrom(address,address,uint256,uint256,bytes)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Data parameter is non-empty\", \"expected\": \"non_empty_bytes\", \"type\": \"data_parameter_check\", \"weight\": 0.1}, {\"description\": \"Token balance transferred correctly\", \"expected_amount\": \"{amount}\", \"from_address\": \"{agent_address}\", \"nft_contract\": \"{nft_address}\", \"to_address\": \"{to_address}\", \"token_id\": \"{token_id}\", \"type\": \"erc1155_balance_transferred\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must own sufficient tokens of this ID\", \"min_balance\": \"{amount}\", \"nft_contract\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"erc1155_balance_check\"}, {\"address\": \"{nft_address}\", \"description\": \"ERC1155 contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"ERC1155\", \"note\": \"Agent must own sufficient tokens to transfer; recipient may need to implement ERC1155Receiver\", \"required_functions\": [\"safeTransferFrom\", \"balanceOf\", \"balanceOfBatch\"]}, \"erc_standard\": \"ERC1155\", \"estimated_gas\": 200000, \"requires_contract\": true, \"requires_custom_token\": true, \"requires_token_ownership\": true, \"tags\": [\"erc1155\", \"multi-token\", \"nft\", \"transfer\", \"data\", \"callback\", \"advanced\"]}", "source_path": "basic_transactions/nft_operations/erc1155_safe_transfer_with_data.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"erc1155_safe_transfer_with_data\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"ERC1155\", \"note\": \"Agent must own sufficient tokens to transfer; recipient may need to implement ERC1155Receiver\", \"required_functions\": [\"safeTransferFrom\", \"balanceOf\", \"balanceOfBatch\"]}, \"erc_standard\": \"ERC1155\", \"estimated_gas\": 200000, \"requires_contract\": true, \"requires_custom_token\": true, \"requires_token_ownership\": true, \"tags\": [\"erc1155\", \"multi-token\", \"nft\", \"transfer\", \"data\", \"callback\", \"advanced\"]}, \"natural_language_templates\": [\"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\"], \"parameters\": {\"amount\": {\"description\": \"Amount of tokens to transfer\", \"generation\": {\"method\": \"fixed\", \"value\": 5}, \"role\": \"transfer_amount\", \"type\": \"integer\"}, \"data_message\": {\"description\": \"Custom data message to include with transfer\", \"generation\": {\"method\": \"from_list\", \"values\": [\"Transfer with metadata\", \"NFT batch transfer\", \"Game item transfer\", \"Token migration\"]}, \"role\": \"parameter\", \"type\": \"string\"}, \"nft_address\": {\"description\": \"ERC1155 multi-token contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC1155 token from environment\", \"env_key\": \"erc1155_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"Multi-token collection name for natural language\", \"generation\": {\"method\": \"fixed\", \"value\": \"TestMultiToken\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"recipient\", \"type\": \"address\"}, \"token_id\": {\"description\": \"Token ID to transfer (token type within the collection)\", \"generation\": {\"method\": \"fixed\", \"value\": 1}, \"role\": \"parameter\", \"type\": \"integer\"}}, \"subcategory\": \"nft_operations\", \"title\": \"ERC1155 Safe Transfer with Data\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.25}, {\"description\": \"Transaction calls correct ERC1155 contract\", \"expected\": \"{nft_address}\", \"type\": \"contract_call\", \"weight\": 0.15}, {\"description\": \"Correct safeTransferFrom function signature\", \"expected\": \"safeTransferFrom(address,address,uint256,uint256,bytes)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Data parameter is non-empty\", \"expected\": \"non_empty_bytes\", \"type\": \"data_parameter_check\", \"weight\": 0.1}, {\"description\": \"Token balance transferred correctly\", \"expected_amount\": \"{amount}\", \"from_address\": \"{agent_address}\", \"nft_contract\": \"{nft_address}\", \"to_address\": \"{to_address}\", \"token_id\": \"{token_id}\", \"type\": \"erc1155_balance_transferred\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must own sufficient tokens of this ID\", \"min_balance\": \"{amount}\", \"nft_contract\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"erc1155_balance_check\"}, {\"address\": \"{nft_address}\", \"description\": \"ERC1155 contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc1155_transfer_single", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "nft_operations", "difficulty": "medium", "title": "ERC1155 Single Token Transfer", "description": "Transfer ERC1155 tokens (single token ID) to another address using the safeTransferFrom function.\n\nTechnical context:\n- ERC1155 is the multi-token standard supporting both fungible and non-fungible tokens\n- Function signature: safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data)\n- The 'from' address must be the current owner or approved operator\n- The 'to' address must implement ERC1155Receiver interface (or be an EOA)\n- The 'id' parameter specifies which token type to transfer\n- The 'amount' parameter specifies how many units to transfer\n- The 'data' parameter is additional data to pass (can be empty bytes)\n- Recommended gas limit: 150000\n\nKey considerations:\n- Create a Contract instance with ERC1155 address and ERC1155 ABI\n- Use encode the function call('safeTransferFrom', [from, to, id, amount, data])\n- Set transaction 'to' to the ERC1155 contract address\n- Set transaction 'value' to 0 (not sending BNB)\n- The 'from' parameter should be the agent's address (current owner)\n- After transfer, balanceOf(to, id) should increase by amount\n- The agent's balance balanceOf(from, id) should decrease by amount", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["erc1155", "multi-token", "nft", "transfer", "semi-fungible", "intermediate"], "parameter_names": ["amount", "nft_address", "nft_name", "to_address", "token_id"], "parameters": "{\"amount\": {\"description\": \"Amount of tokens to transfer\", \"generation\": {\"method\": \"fixed\", \"value\": 10}, \"role\": \"transfer_amount\", \"type\": \"integer\"}, \"nft_address\": {\"description\": \"ERC1155 multi-token contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC1155 token from environment\", \"env_key\": \"erc1155_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"Multi-token collection name for natural language\", \"generation\": {\"method\": \"fixed\", \"value\": \"TestMultiToken\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"recipient\", \"type\": \"address\"}, \"token_id\": {\"description\": \"Token ID to transfer (token type within the collection)\", \"generation\": {\"method\": \"fixed\", \"value\": 1}, \"role\": \"parameter\", \"type\": \"integer\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct ERC1155 contract\", \"expected\": \"{nft_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct safeTransferFrom function signature\", \"expected\": \"safeTransferFrom(address,address,uint256,uint256,bytes)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Token balance transferred correctly\", \"expected_amount\": \"{amount}\", \"from_address\": \"{agent_address}\", \"nft_contract\": \"{nft_address}\", \"to_address\": \"{to_address}\", \"token_id\": \"{token_id}\", \"type\": \"erc1155_balance_transferred\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must own sufficient tokens of this ID\", \"min_balance\": \"{amount}\", \"nft_contract\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"erc1155_balance_check\"}, {\"address\": \"{nft_address}\", \"description\": \"ERC1155 contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"ERC1155\", \"note\": \"Agent must own sufficient tokens to transfer\", \"required_functions\": [\"safeTransferFrom\", \"balanceOf\", \"balanceOfBatch\"]}, \"erc_standard\": \"ERC1155\", \"estimated_gas\": 150000, \"requires_contract\": true, \"requires_custom_token\": true, \"requires_token_ownership\": true, \"tags\": [\"erc1155\", \"multi-token\", \"nft\", \"transfer\", \"semi-fungible\", \"intermediate\"]}", "source_path": "basic_transactions/nft_operations/erc1155_transfer_single.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"erc1155_transfer_single\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"ERC1155\", \"note\": \"Agent must own sufficient tokens to transfer\", \"required_functions\": [\"safeTransferFrom\", \"balanceOf\", \"balanceOfBatch\"]}, \"erc_standard\": \"ERC1155\", \"estimated_gas\": 150000, \"requires_contract\": true, \"requires_custom_token\": true, \"requires_token_ownership\": true, \"tags\": [\"erc1155\", \"multi-token\", \"nft\", \"transfer\", \"semi-fungible\", \"intermediate\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"amount\": {\"description\": \"Amount of tokens to transfer\", \"generation\": {\"method\": \"fixed\", \"value\": 10}, \"role\": \"transfer_amount\", \"type\": \"integer\"}, \"nft_address\": {\"description\": \"ERC1155 multi-token contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC1155 token from environment\", \"env_key\": \"erc1155_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"Multi-token collection name for natural language\", \"generation\": {\"method\": \"fixed\", \"value\": \"TestMultiToken\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"recipient\", \"type\": \"address\"}, \"token_id\": {\"description\": \"Token ID to transfer (token type within the collection)\", \"generation\": {\"method\": \"fixed\", \"value\": 1}, \"role\": \"parameter\", \"type\": \"integer\"}}, \"subcategory\": \"nft_operations\", \"title\": \"ERC1155 Single Token Transfer\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct ERC1155 contract\", \"expected\": \"{nft_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct safeTransferFrom function signature\", \"expected\": \"safeTransferFrom(address,address,uint256,uint256,bytes)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"Token balance transferred correctly\", \"expected_amount\": \"{amount}\", \"from_address\": \"{agent_address}\", \"nft_contract\": \"{nft_address}\", \"to_address\": \"{to_address}\", \"token_id\": \"{token_id}\", \"type\": \"erc1155_balance_transferred\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must own sufficient tokens of this ID\", \"min_balance\": \"{amount}\", \"nft_contract\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"erc1155_balance_check\"}, {\"address\": \"{nft_address}\", \"description\": \"ERC1155 contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc721_approve", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "nft_operations", "difficulty": "medium", "title": "ERC721 Approve", "description": "Approve another address to transfer a specific ERC721 NFT token on your behalf.\n\nTechnical context:\n- Use ERC721's approve(address to, uint256 tokenId) function\n- Grants permission for the approved address to transfer the specific NFT\n- Only one address can be approved per token at a time\n- Setting approval to address(0) clears the approval\n- Function selector: 0x095ea7b3\n- Parameters: to (address, 32 bytes) + tokenId (uint256, 32 bytes)\n- Recommended gas limit: 80000", "natural_language_templates": ["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})"], "chain": "BSC", "network": "mainnet", "tags": ["nft", "erc721", "approve", "authorization", "onchain"], "parameter_names": ["nft_address", "nft_name", "spender_address", "token_id"], "parameters": "{\"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"addresses\": [\"0x0a8901b0E25DEb55A87524f0cC164E9644020EBA\"], \"comment\": \"PancakeSquad NFT on BSC Mainnet\", \"method\": \"from_list\"}, \"role\": \"nft_contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"Human-readable name of the NFT collection\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSquad\"}, \"role\": \"display\", \"type\": \"string\"}, \"spender_address\": {\"description\": \"Address to approve for transferring the NFT\", \"generation\": {\"method\": \"random\"}, \"role\": \"spender\", \"type\": \"address\"}, \"token_id\": {\"description\": \"Unique token ID of the NFT to approve\", \"generation\": {\"comment\": \"Using token ID 1 which will be pre-setup in test environment\", \"method\": \"fixed\", \"value\": 1}, \"role\": \"nft_token_id\", \"type\": \"integer\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.4}, {\"description\": \"Approved address set correctly\", \"expected_approved\": \"{spender_address}\", \"type\": \"approval_check\", \"weight\": 0.4}, {\"description\": \"Correct function selector for approve\", \"expected_selector\": \"0x095ea7b3\", \"type\": \"function_selector\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must own the NFT token\", \"nft_address\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"nft_ownership\"}, {\"description\": \"Agent must have sufficient BNB for gas\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"erc_standard\": \"ERC721\", \"estimated_gas\": 80000, \"network\": \"mainnet\", \"requires_contract\": true, \"tags\": [\"nft\", \"erc721\", \"approve\", \"authorization\", \"onchain\"]}", "source_path": "basic_transactions/nft_operations/erc721_approve.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"erc721_approve\", \"metadata\": {\"erc_standard\": \"ERC721\", \"estimated_gas\": 80000, \"network\": \"mainnet\", \"requires_contract\": true, \"tags\": [\"nft\", \"erc721\", \"approve\", \"authorization\", \"onchain\"]}, \"natural_language_templates\": [\"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})\"], \"parameters\": {\"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"addresses\": [\"0x0a8901b0E25DEb55A87524f0cC164E9644020EBA\"], \"comment\": \"PancakeSquad NFT on BSC Mainnet\", \"method\": \"from_list\"}, \"role\": \"nft_contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"Human-readable name of the NFT collection\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSquad\"}, \"role\": \"display\", \"type\": \"string\"}, \"spender_address\": {\"description\": \"Address to approve for transferring the NFT\", \"generation\": {\"method\": \"random\"}, \"role\": \"spender\", \"type\": \"address\"}, \"token_id\": {\"description\": \"Unique token ID of the NFT to approve\", \"generation\": {\"comment\": \"Using token ID 1 which will be pre-setup in test environment\", \"method\": \"fixed\", \"value\": 1}, \"role\": \"nft_token_id\", \"type\": \"integer\"}}, \"subcategory\": \"nft_operations\", \"title\": \"ERC721 Approve\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.4}, {\"description\": \"Approved address set correctly\", \"expected_approved\": \"{spender_address}\", \"type\": \"approval_check\", \"weight\": 0.4}, {\"description\": \"Correct function selector for approve\", \"expected_selector\": \"0x095ea7b3\", \"type\": \"function_selector\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must own the NFT token\", \"nft_address\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"nft_ownership\"}, {\"description\": \"Agent must have sufficient BNB for gas\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc721_safe_transfer", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "nft_operations", "difficulty": "medium", "title": "ERC721 Safe Transfer", "description": "Safely transfer an ERC721 NFT token to another address using safeTransferFrom.\n\nTechnical context:\n- Use ERC721's safeTransferFrom(address from, address to, uint256 tokenId) function\n- Safe transfer checks if recipient is a contract and verifies it can receive NFTs\n- If recipient is a contract, it must implement onERC721Received() interface\n- Prevents NFTs from being locked in contracts that can't handle them\n- Function selector: 0x42842e0e\n- Parameters: from (address, 32 bytes) + to (address, 32 bytes) + tokenId (uint256, 32 bytes)\n- Recommended gas limit: 150000", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["nft", "erc721", "safe_transfer", "ownership", "onchain"], "parameter_names": ["nft_address", "nft_name", "to_address", "token_id"], "parameters": "{\"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"addresses\": [\"0x0a8901b0E25DEb55A87524f0cC164E9644020EBA\"], \"comment\": \"PancakeSquad NFT on BSC Mainnet\", \"method\": \"from_list\"}, \"role\": \"nft_contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"Human-readable name of the NFT collection\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSquad\"}, \"role\": \"display\", \"type\": \"string\"}, \"to_address\": {\"description\": \"Recipient address (EOA or contract that implements onERC721Received)\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_id\": {\"description\": \"Unique token ID of the NFT to transfer\", \"generation\": {\"comment\": \"Using token ID 1 which will be pre-setup in test environment\", \"method\": \"fixed\", \"value\": 1}, \"role\": \"nft_token_id\", \"type\": \"integer\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"NFT ownership transferred to recipient\", \"expected_new_owner\": \"{to_address}\", \"type\": \"nft_transfer\", \"weight\": 0.4}, {\"comment\": \"safeTransferFrom(address,address,uint256)\", \"description\": \"Correct function selector for safeTransferFrom\", \"expected_selector\": \"0x42842e0e\", \"type\": \"function_selector\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must own the NFT token\", \"nft_address\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"nft_ownership\"}, {\"description\": \"Agent must have sufficient BNB for gas\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"erc_standard\": \"ERC721\", \"estimated_gas\": 150000, \"network\": \"mainnet\", \"requires_contract\": true, \"tags\": [\"nft\", \"erc721\", \"safe_transfer\", \"ownership\", \"onchain\"]}", "source_path": "basic_transactions/nft_operations/erc721_safe_transfer.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"erc721_safe_transfer\", \"metadata\": {\"erc_standard\": \"ERC721\", \"estimated_gas\": 150000, \"network\": \"mainnet\", \"requires_contract\": true, \"tags\": [\"nft\", \"erc721\", \"safe_transfer\", \"ownership\", \"onchain\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"addresses\": [\"0x0a8901b0E25DEb55A87524f0cC164E9644020EBA\"], \"comment\": \"PancakeSquad NFT on BSC Mainnet\", \"method\": \"from_list\"}, \"role\": \"nft_contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"Human-readable name of the NFT collection\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSquad\"}, \"role\": \"display\", \"type\": \"string\"}, \"to_address\": {\"description\": \"Recipient address (EOA or contract that implements onERC721Received)\", \"generation\": {\"method\": \"random\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_id\": {\"description\": \"Unique token ID of the NFT to transfer\", \"generation\": {\"comment\": \"Using token ID 1 which will be pre-setup in test environment\", \"method\": \"fixed\", \"value\": 1}, \"role\": \"nft_token_id\", \"type\": \"integer\"}}, \"subcategory\": \"nft_operations\", \"title\": \"ERC721 Safe Transfer\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"NFT ownership transferred to recipient\", \"expected_new_owner\": \"{to_address}\", \"type\": \"nft_transfer\", \"weight\": 0.4}, {\"comment\": \"safeTransferFrom(address,address,uint256)\", \"description\": \"Correct function selector for safeTransferFrom\", \"expected_selector\": \"0x42842e0e\", \"type\": \"function_selector\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must own the NFT token\", \"nft_address\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"nft_ownership\"}, {\"description\": \"Agent must have sufficient BNB for gas\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc721_set_approval_for_all", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "nft_operations", "difficulty": "medium", "title": "ERC721 Set Approval For All", "description": "Approve or revoke an operator to manage all of your ERC721 NFTs in a collection.\n\nTechnical context:\n- Use ERC721's setApprovalForAll(address operator, bool approved) function\n- Grants/revokes permission for the operator to transfer ALL your NFTs in this collection\n- More efficient than approving each token individually\n- Commonly used by NFT marketplaces (OpenSea, etc.) and games\n- Setting approved=true grants full control, approved=false revokes it\n- Function selector: 0xa22cb465\n- Parameters: operator (address, 32 bytes) + approved (bool, 32 bytes)\n- Recommended gas limit: 80000", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["nft", "erc721", "approval_for_all", "operator", "batch_authorization", "onchain"], "parameter_names": ["approved", "nft_address", "nft_name", "operator_address"], "parameters": "{\"approved\": {\"description\": \"True to grant approval, false to revoke\", \"generation\": {\"comment\": \"Default to granting approval (true)\", \"method\": \"fixed\", \"value\": true}, \"role\": \"approval_status\", \"type\": \"boolean\"}, \"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"addresses\": [\"0x0a8901b0E25DEb55A87524f0cC164E9644020EBA\"], \"comment\": \"PancakeSquad NFT on BSC Mainnet\", \"method\": \"from_list\"}, \"role\": \"nft_contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"Human-readable name of the NFT collection\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSquad\"}, \"role\": \"display\", \"type\": \"string\"}, \"operator_address\": {\"description\": \"Address to approve as operator for all NFTs\", \"generation\": {\"method\": \"random\"}, \"role\": \"operator\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.4}, {\"description\": \"Operator approval status set correctly\", \"expected_approved\": \"{approved}\", \"type\": \"approval_for_all_check\", \"weight\": 0.4}, {\"description\": \"Correct function selector for setApprovalForAll\", \"expected_selector\": \"0xa22cb465\", \"type\": \"function_selector\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB for gas\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"erc_standard\": \"ERC721\", \"estimated_gas\": 80000, \"network\": \"mainnet\", \"requires_contract\": true, \"tags\": [\"nft\", \"erc721\", \"approval_for_all\", \"operator\", \"batch_authorization\", \"onchain\"]}", "source_path": "basic_transactions/nft_operations/erc721_set_approval_for_all.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"erc721_set_approval_for_all\", \"metadata\": {\"erc_standard\": \"ERC721\", \"estimated_gas\": 80000, \"network\": \"mainnet\", \"requires_contract\": true, \"tags\": [\"nft\", \"erc721\", \"approval_for_all\", \"operator\", \"batch_authorization\", \"onchain\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"approved\": {\"description\": \"True to grant approval, false to revoke\", \"generation\": {\"comment\": \"Default to granting approval (true)\", \"method\": \"fixed\", \"value\": true}, \"role\": \"approval_status\", \"type\": \"boolean\"}, \"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"addresses\": [\"0x0a8901b0E25DEb55A87524f0cC164E9644020EBA\"], \"comment\": \"PancakeSquad NFT on BSC Mainnet\", \"method\": \"from_list\"}, \"role\": \"nft_contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"Human-readable name of the NFT collection\", \"generation\": {\"method\": \"fixed\", \"value\": \"PancakeSquad\"}, \"role\": \"display\", \"type\": \"string\"}, \"operator_address\": {\"description\": \"Address to approve as operator for all NFTs\", \"generation\": {\"method\": \"random\"}, \"role\": \"operator\", \"type\": \"address\"}}, \"subcategory\": \"nft_operations\", \"title\": \"ERC721 Set Approval For All\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.4}, {\"description\": \"Operator approval status set correctly\", \"expected_approved\": \"{approved}\", \"type\": \"approval_for_all_check\", \"weight\": 0.4}, {\"description\": \"Correct function selector for setApprovalForAll\", \"expected_selector\": \"0xa22cb465\", \"type\": \"function_selector\", \"weight\": 0.2}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB for gas\", \"min_balance\": \"0.01 BNB\", \"type\": \"balance\"}]}, \"version\": \"2.0.0\"}"} {"id": "erc721_transfer", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "nft_operations", "difficulty": "medium", "title": "ERC721 NFT Transfer", "description": "Transfer an ERC721 NFT token to another address using the transferFrom function.\n\nTechnical context:\n- ERC721 is the standard for non-fungible tokens (NFTs)\n- Function signature: transferFrom(address from, address to, uint256 tokenId)\n- The 'from' address must be the current owner of the NFT\n- The caller must be the owner or approved operator\n- Recommended gas limit: 100000\n\nKey considerations:\n- Create a Contract instance with NFT address and ERC721 ABI\n- Use encode the function call('transferFrom', [from, to, tokenId])\n- Set transaction 'to' to the NFT contract address\n- Set transaction 'value' to 0 (not sending BNB)\n- The 'from' parameter should be the agent's address (current owner)\n- After transfer, ownerOf(tokenId) should return the recipient address\n- The agent's NFT balance decreases by 1, recipient's increases by 1", "natural_language_templates": ["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}"], "chain": "BSC", "network": "mainnet", "tags": ["erc721", "nft", "transfer", "ownership", "intermediate"], "parameter_names": ["nft_address", "nft_name", "to_address", "token_id"], "parameters": "{\"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC721 test NFT contract from environment\", \"env_key\": \"erc721_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"NFT collection name for natural language\", \"generation\": {\"method\": \"from_list\", \"values\": [\"PancakeSquad\"]}, \"role\": \"parameter\", \"type\": \"string\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"recipient\", \"type\": \"address\"}, \"token_id\": {\"description\": \"NFT token ID to transfer\", \"generation\": {\"method\": \"fixed\", \"value\": 1}, \"role\": \"parameter\", \"type\": \"integer\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct NFT contract\", \"expected\": \"{nft_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct transferFrom function signature\", \"expected\": \"transferFrom(address,address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"NFT ownership transferred to recipient\", \"expected_owner\": \"{to_address}\", \"nft_contract\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"nft_ownership_transferred\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must own the NFT token\", \"nft_contract\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"nft_ownership\"}, {\"address\": \"{nft_address}\", \"description\": \"NFT contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_requirements\": {\"contract_type\": \"ERC721\", \"note\": \"Agent must own the NFT to transfer\", \"required_functions\": [\"transferFrom\", \"ownerOf\", \"balanceOf\"]}, \"estimated_gas\": 100000, \"requires_contract\": true, \"requires_nft_ownership\": true, \"tags\": [\"erc721\", \"nft\", \"transfer\", \"ownership\", \"intermediate\"]}", "source_path": "basic_transactions/nft_operations/erc721_transfer.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"medium\", \"id\": \"erc721_transfer\", \"metadata\": {\"contract_requirements\": {\"contract_type\": \"ERC721\", \"note\": \"Agent must own the NFT to transfer\", \"required_functions\": [\"transferFrom\", \"ownerOf\", \"balanceOf\"]}, \"estimated_gas\": 100000, \"requires_contract\": true, \"requires_nft_ownership\": true, \"tags\": [\"erc721\", \"nft\", \"transfer\", \"ownership\", \"intermediate\"]}, \"natural_language_templates\": [\"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}\"], \"parameters\": {\"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"comment\": \"Use dynamically deployed ERC721 test NFT contract from environment\", \"env_key\": \"erc721_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"nft_name\": {\"description\": \"NFT collection name for natural language\", \"generation\": {\"method\": \"from_list\", \"values\": [\"PancakeSquad\"]}, \"role\": \"parameter\", \"type\": \"string\"}, \"to_address\": {\"description\": \"Recipient address\", \"generation\": {\"method\": \"random\"}, \"role\": \"recipient\", \"type\": \"address\"}, \"token_id\": {\"description\": \"NFT token ID to transfer\", \"generation\": {\"method\": \"fixed\", \"value\": 1}, \"role\": \"parameter\", \"type\": \"integer\"}}, \"subcategory\": \"nft_operations\", \"title\": \"ERC721 NFT Transfer\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"description\": \"Transaction calls correct NFT contract\", \"expected\": \"{nft_address}\", \"type\": \"contract_call\", \"weight\": 0.2}, {\"description\": \"Correct transferFrom function signature\", \"expected\": \"transferFrom(address,address,uint256)\", \"type\": \"function_signature\", \"weight\": 0.2}, {\"description\": \"NFT ownership transferred to recipient\", \"expected_owner\": \"{to_address}\", \"nft_contract\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"nft_ownership_transferred\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"Agent must own the NFT token\", \"nft_contract\": \"{nft_address}\", \"token_id\": \"{token_id}\", \"type\": \"nft_ownership\"}, {\"address\": \"{nft_address}\", \"description\": \"NFT contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "query_nft_balance", "split": "atomic", "task_type": "atomic", "version": "", "category": "basic_transactions", "subcategory": "nft_queries", "difficulty": "easy", "title": "Query NFT Balance", "description": "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.", "natural_language_templates": ["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}}"], "chain": "BSC", "network": "mainnet", "tags": ["erc721", "nft", "balance", "balanceOf", "query"], "parameter_names": ["expected_balance", "nft_address", "query_address"], "parameters": "{\"expected_balance\": {\"description\": \"Expected NFT balance (test account owns 10 NFTs)\", \"generation\": {\"method\": \"fixed\", \"value\": 10}, \"type\": \"integer\"}, \"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"env_key\": \"erc721_token_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"query_address\": {\"description\": \"Address to query NFT balance for\", \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"type\": \"address\"}}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query NFT balance\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"balance\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"NFT balance does not match expected value\", \"field\": \"balance_correctness\", \"weight\": 30}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the ERC721 balanceOf(address) function\", \"Learn the difference between ERC721 and ERC1155 balanceOf\", \"Master querying NFT ownership counts\", \"Understand how to verify user NFT holdings\", \"Learn about NFT collection management\"], \"notes\": [\"ERC721 balanceOf(address) returns uint256 - total count of NFTs owned\", \"ERC1155 balanceOf(address, uint256) requires token ID parameter\", \"Balance represents count, not token IDs\", \"Use enumeration extensions to get actual token IDs owned\", \"Zero address will revert in most implementations\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_nft_owner\", \"query_erc20_balance\"], \"tags\": [\"erc721\", \"nft\", \"balance\", \"balanceOf\", \"query\"]}", "source_path": "basic_transactions/nft_queries/query_nft_balance.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"basic_transactions\", \"description\": \"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.\", \"difficulty\": \"easy\", \"id\": \"query_nft_balance\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the ERC721 balanceOf(address) function\", \"Learn the difference between ERC721 and ERC1155 balanceOf\", \"Master querying NFT ownership counts\", \"Understand how to verify user NFT holdings\", \"Learn about NFT collection management\"], \"notes\": [\"ERC721 balanceOf(address) returns uint256 - total count of NFTs owned\", \"ERC1155 balanceOf(address, uint256) requires token ID parameter\", \"Balance represents count, not token IDs\", \"Use enumeration extensions to get actual token IDs owned\", \"Zero address will revert in most implementations\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_nft_owner\", \"query_erc20_balance\"], \"tags\": [\"erc721\", \"nft\", \"balance\", \"balanceOf\", \"query\"]}, \"natural_language_templates\": [\"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}}\"], \"parameters\": {\"expected_balance\": {\"description\": \"Expected NFT balance (test account owns 10 NFTs)\", \"generation\": {\"method\": \"fixed\", \"value\": 10}, \"type\": \"integer\"}, \"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"env_key\": \"erc721_token_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"query_address\": {\"description\": \"Address to query NFT balance for\", \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"type\": \"address\"}}, \"subcategory\": \"nft_queries\", \"title\": \"Query NFT Balance\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query NFT balance\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"balance\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"NFT balance does not match expected value\", \"field\": \"balance_correctness\", \"weight\": 30}], \"type\": \"query\"}}"} {"id": "query_nft_owner", "split": "atomic", "task_type": "atomic", "version": "", "category": "basic_transactions", "subcategory": "nft_queries", "difficulty": "easy", "title": "Query NFT Owner", "description": "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.", "natural_language_templates": ["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}}"], "chain": "BSC", "network": "mainnet", "tags": ["erc721", "nft", "owner", "query", "ownerOf"], "parameter_names": ["expected_owner", "nft_address", "token_id"], "parameters": "{\"expected_owner\": {\"description\": \"Expected owner address (test account)\", \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"env_key\": \"erc721_token_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"token_id\": {\"description\": \"NFT token ID to query ownership for\", \"generation\": {\"max\": 10, \"method\": \"random\", \"min\": 1}, \"type\": \"integer\"}}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query NFT owner\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"owner\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"NFT owner address does not match expected value\", \"field\": \"owner_correctness\", \"weight\": 30}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the ERC721 ownerOf() function\", \"Learn to query NFT ownership information\", \"Master address comparison and checksum addresses\", \"Understand the importance of ownership verification in NFT operations\"], \"notes\": [\"ownerOf(tokenId) returns the address of the owner\", \"Will revert if token doesn't exist\", \"Always use checksum addresses for comparison\", \"Essential function for verifying NFT ownership before transfers\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_nft_approval_status\", \"erc721_transfer\"], \"tags\": [\"erc721\", \"nft\", \"owner\", \"query\", \"ownerOf\"]}", "source_path": "basic_transactions/nft_queries/query_nft_owner.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"basic_transactions\", \"description\": \"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.\", \"difficulty\": \"easy\", \"id\": \"query_nft_owner\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the ERC721 ownerOf() function\", \"Learn to query NFT ownership information\", \"Master address comparison and checksum addresses\", \"Understand the importance of ownership verification in NFT operations\"], \"notes\": [\"ownerOf(tokenId) returns the address of the owner\", \"Will revert if token doesn't exist\", \"Always use checksum addresses for comparison\", \"Essential function for verifying NFT ownership before transfers\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_nft_approval_status\", \"erc721_transfer\"], \"tags\": [\"erc721\", \"nft\", \"owner\", \"query\", \"ownerOf\"]}, \"natural_language_templates\": [\"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}}\"], \"parameters\": {\"expected_owner\": {\"description\": \"Expected owner address (test account)\", \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"env_key\": \"erc721_token_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"token_id\": {\"description\": \"NFT token ID to query ownership for\", \"generation\": {\"max\": 10, \"method\": \"random\", \"min\": 1}, \"type\": \"integer\"}}, \"subcategory\": \"nft_queries\", \"title\": \"Query NFT Owner\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query NFT owner\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"owner\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"NFT owner address does not match expected value\", \"field\": \"owner_correctness\", \"weight\": 30}], \"type\": \"query\"}}"} {"id": "query_nft_token_uri", "split": "atomic", "task_type": "atomic", "version": "", "category": "basic_transactions", "subcategory": "nft_queries", "difficulty": "easy", "title": "Query NFT Token URI", "description": "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.", "natural_language_templates": ["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}}"], "chain": "BSC", "network": "mainnet", "tags": ["erc721", "nft", "metadata", "tokenURI", "query"], "parameter_names": ["nft_address", "token_id"], "parameters": "{\"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"env_key\": \"erc721_token_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"token_id\": {\"description\": \"NFT token ID to query URI for\", \"generation\": {\"max\": 10, \"method\": \"random\", \"min\": 1}, \"type\": \"integer\"}}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query NFT token URI\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"tokenURI\"], \"weight\": 30}, {\"condition\": \"is_valid_string\", \"error_message\": \"Token URI must be a non-empty string\", \"field\": \"token_uri_format\", \"weight\": 30}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the ERC721 tokenURI() function\", \"Learn about NFT metadata storage and URIs\", \"Master handling string return types from smart contracts\", \"Understand the importance of metadata in NFT ecosystems\", \"Learn about IPFS, HTTP, and data URIs for NFT metadata\"], \"notes\": [\"tokenURI(tokenId) returns a string (the metadata URI)\", \"URIs can be HTTP(S), IPFS, or data URIs\", \"Will revert if token doesn't exist\", \"Some NFTs use base URI + token ID concatenation\", \"Token URI typically points to JSON metadata following ERC721 metadata standard\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_nft_owner\", \"erc721_transfer\"], \"tags\": [\"erc721\", \"nft\", \"metadata\", \"tokenURI\", \"query\"]}", "source_path": "basic_transactions/nft_queries/query_nft_token_uri.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"basic_transactions\", \"description\": \"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.\", \"difficulty\": \"easy\", \"id\": \"query_nft_token_uri\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the ERC721 tokenURI() function\", \"Learn about NFT metadata storage and URIs\", \"Master handling string return types from smart contracts\", \"Understand the importance of metadata in NFT ecosystems\", \"Learn about IPFS, HTTP, and data URIs for NFT metadata\"], \"notes\": [\"tokenURI(tokenId) returns a string (the metadata URI)\", \"URIs can be HTTP(S), IPFS, or data URIs\", \"Will revert if token doesn't exist\", \"Some NFTs use base URI + token ID concatenation\", \"Token URI typically points to JSON metadata following ERC721 metadata standard\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_nft_owner\", \"erc721_transfer\"], \"tags\": [\"erc721\", \"nft\", \"metadata\", \"tokenURI\", \"query\"]}, \"natural_language_templates\": [\"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}}\"], \"parameters\": {\"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"env_key\": \"erc721_token_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"token_id\": {\"description\": \"NFT token ID to query URI for\", \"generation\": {\"max\": 10, \"method\": \"random\", \"min\": 1}, \"type\": \"integer\"}}, \"subcategory\": \"nft_queries\", \"title\": \"Query NFT Token URI\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query NFT token URI\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"tokenURI\"], \"weight\": 30}, {\"condition\": \"is_valid_string\", \"error_message\": \"Token URI must be a non-empty string\", \"field\": \"token_uri_format\", \"weight\": 30}], \"type\": \"query\"}}"} {"id": "query_bnb_balance", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "queries", "difficulty": "easy", "title": "Query BNB Balance", "description": "Query the BNB balance of a specific address using eth_getBalance RPC call.\n\nTechnical context:\n- Use provider.getBalance(address) to query balance\n- The return value is in Wei (1 BNB = 10^18 Wei)\n- This is a read-only operation, no transaction is required\n- Balance should be returned as BigInt or string\n\nKey considerations:\n- Use ethers.js provider.getBalance() method\n- Return the balance value in the result object\n- Include both raw Wei value and human-readable BNB value\n- No transaction signing or gas fee required", "natural_language_templates": ["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}?"], "chain": "BSC", "network": "mainnet", "tags": ["query", "balance", "bnb", "read-only", "basic"], "parameter_names": ["expected_balance", "query_address"], "parameters": "{\"expected_balance\": {\"description\": \"Expected BNB balance in BNB (will be set via Anvil)\", \"generation\": {\"comment\": \"Random balance between 0.5 and 50 BNB\", \"decimals\": 3, \"max\": 50.0, \"method\": \"random\", \"min\": 0.5}, \"role\": \"expected_result\", \"type\": \"number\"}, \"query_address\": {\"description\": \"Address to query BNB balance for\", \"generation\": {\"comment\": \"Random address for query operation\", \"method\": \"random\"}, \"role\": \"query_target\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Query executed successfully\", \"type\": \"query_success\", \"weight\": 0.3}, {\"description\": \"Return value format is correct (contains balance_wei)\", \"type\": \"return_format\", \"weight\": 0.3}, {\"description\": \"Balance value matches chain state\", \"type\": \"balance_correctness\", \"weight\": 0.4}], \"pre_conditions\": [{\"description\": \"Query address must be valid\", \"type\": \"address_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"operation_type\": \"query\", \"requires_contract\": false, \"tags\": [\"query\", \"balance\", \"bnb\", \"read-only\", \"basic\"]}", "source_path": "basic_transactions/queries/query_bnb_balance.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"easy\", \"id\": \"query_bnb_balance\", \"metadata\": {\"estimated_gas\": 0, \"operation_type\": \"query\", \"requires_contract\": false, \"tags\": [\"query\", \"balance\", \"bnb\", \"read-only\", \"basic\"]}, \"natural_language_templates\": [\"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}?\"], \"parameters\": {\"expected_balance\": {\"description\": \"Expected BNB balance in BNB (will be set via Anvil)\", \"generation\": {\"comment\": \"Random balance between 0.5 and 50 BNB\", \"decimals\": 3, \"max\": 50.0, \"method\": \"random\", \"min\": 0.5}, \"role\": \"expected_result\", \"type\": \"number\"}, \"query_address\": {\"description\": \"Address to query BNB balance for\", \"generation\": {\"comment\": \"Random address for query operation\", \"method\": \"random\"}, \"role\": \"query_target\", \"type\": \"address\"}}, \"subcategory\": \"queries\", \"title\": \"Query BNB Balance\", \"validation\": {\"post_conditions\": [{\"description\": \"Query executed successfully\", \"type\": \"query_success\", \"weight\": 0.3}, {\"description\": \"Return value format is correct (contains balance_wei)\", \"type\": \"return_format\", \"weight\": 0.3}, {\"description\": \"Balance value matches chain state\", \"type\": \"balance_correctness\", \"weight\": 0.4}], \"pre_conditions\": [{\"description\": \"Query address must be valid\", \"type\": \"address_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "query_erc20_allowance", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "queries", "difficulty": "easy", "title": "Query ERC20 Token Allowance", "description": "Query the ERC20 token allowance granted by an owner to a spender by calling the allowance function.\n\nTechnical context:\n- Use contract.allowance(owner, spender) to query the approved amount\n- The return value is in token's smallest unit (considering decimals)\n- This is a read-only view function, no transaction is required\n- Allowance represents how much the spender can transfer on behalf of the owner\n\nKey considerations:\n- Create contract instance with token address and ERC20 ABI\n- Call allowance(address owner, address spender) view function\n- Return both raw allowance (in wei/smallest unit) and human-readable allowance\n- Consider token decimals when converting to human-readable format", "natural_language_templates": ["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}?"], "chain": "BSC", "network": "mainnet", "tags": ["query", "allowance", "erc20", "read-only", "approval"], "parameter_names": ["expected_allowance", "owner_address", "spender_address", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"expected_allowance\": {\"description\": \"Expected allowance in tokens (will be set via Anvil)\", \"generation\": {\"comment\": \"Random allowance between 100 and 10000 tokens\", \"decimals\": 2, \"max\": 10000.0, \"method\": \"random\", \"min\": 100.0}, \"role\": \"expected_result\", \"type\": \"number\"}, \"owner_address\": {\"description\": \"Token owner address (who granted the allowance)\", \"generation\": {\"comment\": \"Random address for query operation\", \"method\": \"random\"}, \"role\": \"owner\", \"type\": \"address\"}, \"spender_address\": {\"description\": \"Spender address (who received the allowance)\", \"generation\": {\"comment\": \"Random address for query operation\", \"method\": \"random\"}, \"role\": \"spender\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"comment\": \"Use locally deployed ERC1363 test token (standard OpenZeppelin ERC20)\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"display\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Query executed successfully\", \"type\": \"query_success\", \"weight\": 0.3}, {\"description\": \"Return value format is correct (contains allowance_raw)\", \"type\": \"return_format\", \"weight\": 0.3}, {\"description\": \"Allowance value matches chain state\", \"type\": \"allowance_correctness\", \"weight\": 0.4}], \"pre_conditions\": [{\"description\": \"Owner and spender addresses must be valid\", \"type\": \"address_exists\"}, {\"description\": \"Token contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"erc_standard\": \"ERC20\", \"estimated_gas\": 0, \"operation_type\": \"query\", \"requires_contract\": true, \"tags\": [\"query\", \"allowance\", \"erc20\", \"read-only\", \"approval\"]}", "source_path": "basic_transactions/queries/query_erc20_allowance.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"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\"], \"difficulty\": \"easy\", \"id\": \"query_erc20_allowance\", \"metadata\": {\"erc_standard\": \"ERC20\", \"estimated_gas\": 0, \"operation_type\": \"query\", \"requires_contract\": true, \"tags\": [\"query\", \"allowance\", \"erc20\", \"read-only\", \"approval\"]}, \"natural_language_templates\": [\"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}?\"], \"parameters\": {\"expected_allowance\": {\"description\": \"Expected allowance in tokens (will be set via Anvil)\", \"generation\": {\"comment\": \"Random allowance between 100 and 10000 tokens\", \"decimals\": 2, \"max\": 10000.0, \"method\": \"random\", \"min\": 100.0}, \"role\": \"expected_result\", \"type\": \"number\"}, \"owner_address\": {\"description\": \"Token owner address (who granted the allowance)\", \"generation\": {\"comment\": \"Random address for query operation\", \"method\": \"random\"}, \"role\": \"owner\", \"type\": \"address\"}, \"spender_address\": {\"description\": \"Spender address (who received the allowance)\", \"generation\": {\"comment\": \"Random address for query operation\", \"method\": \"random\"}, \"role\": \"spender\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"comment\": \"Use locally deployed ERC1363 test token (standard OpenZeppelin ERC20)\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"display\", \"type\": \"string\"}}, \"subcategory\": \"queries\", \"title\": \"Query ERC20 Token Allowance\", \"validation\": {\"post_conditions\": [{\"description\": \"Query executed successfully\", \"type\": \"query_success\", \"weight\": 0.3}, {\"description\": \"Return value format is correct (contains allowance_raw)\", \"type\": \"return_format\", \"weight\": 0.3}, {\"description\": \"Allowance value matches chain state\", \"type\": \"allowance_correctness\", \"weight\": 0.4}], \"pre_conditions\": [{\"description\": \"Owner and spender addresses must be valid\", \"type\": \"address_exists\"}, {\"description\": \"Token contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "query_erc20_balance", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "basic_transactions", "subcategory": "queries", "difficulty": "easy", "title": "Query ERC20 Token Balance", "description": "Query the ERC20 token balance of a specific address by calling the balanceOf function.\n\nTechnical context:\n- Use contract.balanceOf(address) to query token balance\n- The return value is in token's smallest unit (considering decimals)\n- This is a read-only view function, no transaction is required\n- Balance should be returned as uint256\n\nKey considerations:\n- Create contract instance with token address and ERC20 ABI\n- Call balanceOf(address) view function\n- Return both raw balance (in wei/smallest unit) and human-readable balance\n- Consider token decimals when converting to human-readable format", "natural_language_templates": ["Query the {token_symbol} balance of address {query_address}", "Check the {token_symbol} token balance for {query_address}", "Get the balance of {token_symbol} (token address: {token_address}) for {query_address}", "What is the {token_symbol} balance of address {query_address}?"], "chain": "BSC", "network": "mainnet", "tags": ["query", "balance", "erc20", "read-only", "basic"], "parameter_names": ["expected_balance", "query_address", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"expected_balance\": {\"description\": \"Expected token balance in tokens (will be set via Anvil)\", \"generation\": {\"comment\": \"Random balance between 10 and 5000 tokens\", \"decimals\": 2, \"max\": 5000.0, \"method\": \"random\", \"min\": 10.0}, \"role\": \"expected_result\", \"type\": \"number\"}, \"query_address\": {\"description\": \"Address to query token balance for\", \"generation\": {\"comment\": \"Random address for query operation\", \"method\": \"random\"}, \"role\": \"query_target\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"comment\": \"Use locally deployed ERC1363 test token (standard OpenZeppelin ERC20)\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"display\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Query executed successfully\", \"type\": \"query_success\", \"weight\": 0.3}, {\"description\": \"Return value format is correct (contains balance_raw)\", \"type\": \"return_format\", \"weight\": 0.3}, {\"description\": \"Balance value matches chain state\", \"type\": \"balance_correctness\", \"weight\": 0.4}], \"pre_conditions\": [{\"description\": \"Query address must be valid\", \"type\": \"address_exists\"}, {\"description\": \"Token contract must exist\", \"type\": \"contract_exists\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"erc_standard\": \"ERC20\", \"estimated_gas\": 0, \"operation_type\": \"query\", \"requires_contract\": true, \"tags\": [\"query\", \"balance\", \"erc20\", \"read-only\", \"basic\"]}", "source_path": "basic_transactions/queries/query_erc20_balance.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"basic_transactions\", \"description\": [\"Query the ERC20 token balance of a specific address by calling the balanceOf function.\", \"\", \"Technical context:\", \"- Use contract.balanceOf(address) to query token balance\", \"- The return value is in token's smallest unit (considering decimals)\", \"- This is a read-only view function, no transaction is required\", \"- Balance should be returned as uint256\", \"\", \"Key considerations:\", \"- Create contract instance with token address and ERC20 ABI\", \"- Call balanceOf(address) view function\", \"- Return both raw balance (in wei/smallest unit) and human-readable balance\", \"- Consider token decimals when converting to human-readable format\"], \"difficulty\": \"easy\", \"id\": \"query_erc20_balance\", \"metadata\": {\"erc_standard\": \"ERC20\", \"estimated_gas\": 0, \"operation_type\": \"query\", \"requires_contract\": true, \"tags\": [\"query\", \"balance\", \"erc20\", \"read-only\", \"basic\"]}, \"natural_language_templates\": [\"Query the {token_symbol} balance of address {query_address}\", \"Check the {token_symbol} token balance for {query_address}\", \"Get the balance of {token_symbol} (token address: {token_address}) for {query_address}\", \"What is the {token_symbol} balance of address {query_address}?\"], \"parameters\": {\"expected_balance\": {\"description\": \"Expected token balance in tokens (will be set via Anvil)\", \"generation\": {\"comment\": \"Random balance between 10 and 5000 tokens\", \"decimals\": 2, \"max\": 5000.0, \"method\": \"random\", \"min\": 10.0}, \"role\": \"expected_result\", \"type\": \"number\"}, \"query_address\": {\"description\": \"Address to query token balance for\", \"generation\": {\"comment\": \"Random address for query operation\", \"method\": \"random\"}, \"role\": \"query_target\", \"type\": \"address\"}, \"token_address\": {\"description\": \"ERC20 token contract address\", \"generation\": {\"comment\": \"Use locally deployed ERC1363 test token (standard OpenZeppelin ERC20)\", \"env_key\": \"erc1363_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"T1363\"}, \"role\": \"display\", \"type\": \"string\"}}, \"subcategory\": \"queries\", \"title\": \"Query ERC20 Token Balance\", \"validation\": {\"post_conditions\": [{\"description\": \"Query executed successfully\", \"type\": \"query_success\", \"weight\": 0.3}, {\"description\": \"Return value format is correct (contains balance_raw)\", \"type\": \"return_format\", \"weight\": 0.3}, {\"description\": \"Balance value matches chain state\", \"type\": \"balance_correctness\", \"weight\": 0.4}], \"pre_conditions\": [{\"description\": \"Query address must be valid\", \"type\": \"address_exists\"}, {\"description\": \"Token contract must exist\", \"type\": \"contract_exists\"}]}, \"version\": \"2.0.0\"}"} {"id": "query_nft_approval_status", "split": "atomic", "task_type": "atomic", "version": "", "category": "basic_transactions", "subcategory": "queries", "difficulty": "easy", "title": "Query NFT Approval Status", "description": "Query the approved address for a specific NFT token ID before transfer", "natural_language_templates": ["Check who is approved to transfer NFT token #{token_id} from the {nft_symbol} collection at {nft_address}", "Query the approval status for NFT #{token_id} in the {nft_symbol} collection", "Find out which address is authorized to manage NFT token {token_id} from contract {nft_address}", "Get the approved operator for token ID {token_id} in the NFT collection {nft_symbol}"], "chain": "BSC", "network": "mainnet", "tags": ["query", "nft", "erc721", "approval", "read-only"], "parameter_names": ["expected_approved_address", "nft_address", "nft_symbol", "token_id"], "parameters": "{\"expected_approved_address\": {\"description\": \"Expected approved address (randomly generated)\", \"generation\": {\"comment\": \"Random address to be set as approved operator\", \"method\": \"random\"}, \"role\": \"validation\", \"type\": \"address\"}, \"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"comment\": \"Use locally deployed ERC721 test NFT\", \"env_key\": \"erc721_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"nft_symbol\": {\"description\": \"NFT collection symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"NFT\"}, \"role\": \"display\", \"type\": \"string\"}, \"token_id\": {\"description\": \"NFT token ID to query approval for\", \"generation\": {\"comment\": \"Test NFT has tokens 1-10\", \"max\": 10, \"method\": \"random\", \"min\": 1}, \"role\": \"parameter\", \"type\": \"integer\"}}", "validation": "{\"checks\": [{\"description\": \"Query executed successfully\", \"name\": \"query_execution\", \"points\": 30}, {\"description\": \"Return format correct (includes approved_address field)\", \"name\": \"return_format\", \"points\": 30}, {\"description\": \"Approved address matches expected value\", \"name\": \"approval_correctness\", \"points\": 40}], \"type\": \"query_validation\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_type\": \"erc721\", \"estimated_gas\": 24000, \"learning_objectives\": [\"Query NFT approval status using getApproved()\", \"Understand ERC721 approval mechanism\", \"Handle address return types\"], \"operation_type\": \"query\", \"requires_contract\": true, \"requires_native_token\": false, \"tags\": [\"query\", \"nft\", \"erc721\", \"approval\", \"read-only\"]}", "source_path": "basic_transactions/queries/query_nft_approval_status.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"basic_transactions\", \"description\": \"Query the approved address for a specific NFT token ID before transfer\", \"difficulty\": \"easy\", \"id\": \"query_nft_approval_status\", \"metadata\": {\"contract_type\": \"erc721\", \"estimated_gas\": 24000, \"learning_objectives\": [\"Query NFT approval status using getApproved()\", \"Understand ERC721 approval mechanism\", \"Handle address return types\"], \"operation_type\": \"query\", \"requires_contract\": true, \"requires_native_token\": false, \"tags\": [\"query\", \"nft\", \"erc721\", \"approval\", \"read-only\"]}, \"natural_language_templates\": [\"Check who is approved to transfer NFT token #{token_id} from the {nft_symbol} collection at {nft_address}\", \"Query the approval status for NFT #{token_id} in the {nft_symbol} collection\", \"Find out which address is authorized to manage NFT token {token_id} from contract {nft_address}\", \"Get the approved operator for token ID {token_id} in the NFT collection {nft_symbol}\"], \"parameters\": {\"expected_approved_address\": {\"description\": \"Expected approved address (randomly generated)\", \"generation\": {\"comment\": \"Random address to be set as approved operator\", \"method\": \"random\"}, \"role\": \"validation\", \"type\": \"address\"}, \"nft_address\": {\"description\": \"ERC721 NFT contract address\", \"generation\": {\"comment\": \"Use locally deployed ERC721 test NFT\", \"env_key\": \"erc721_token_address\", \"method\": \"from_env\"}, \"role\": \"contract\", \"type\": \"address\"}, \"nft_symbol\": {\"description\": \"NFT collection symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"NFT\"}, \"role\": \"display\", \"type\": \"string\"}, \"token_id\": {\"description\": \"NFT token ID to query approval for\", \"generation\": {\"comment\": \"Test NFT has tokens 1-10\", \"max\": 10, \"method\": \"random\", \"min\": 1}, \"role\": \"parameter\", \"type\": \"integer\"}}, \"subcategory\": \"queries\", \"title\": \"Query NFT Approval Status\", \"validation\": {\"checks\": [{\"description\": \"Query executed successfully\", \"name\": \"query_execution\", \"points\": 30}, {\"description\": \"Return format correct (includes approved_address field)\", \"name\": \"return_format\", \"points\": 30}, {\"description\": \"Approved address matches expected value\", \"name\": \"approval_correctness\", \"points\": 40}], \"type\": \"query_validation\"}}"} {"id": "query_token_metadata", "split": "atomic", "task_type": "atomic", "version": "", "category": "basic_transactions", "subcategory": "token_info_queries", "difficulty": "easy", "title": "Query Token Metadata", "description": "Query comprehensive metadata of an ERC20 token by calling multiple view functions: name(), symbol(), decimals(), and totalSupply(). This demonstrates batch querying capabilities and handling of standard ERC20 token information. Note that some non-standard tokens may not implement all these functions, so proper error handling is important.", "natural_language_templates": ["Query the metadata for token at {{token_address}} including name, symbol, decimals, and total supply", "Get comprehensive information about the ERC20 token at {{token_address}}", "Retrieve token details (name, symbol, decimals, totalSupply) for {{token_address}}", "Check the basic information of token {{token_address}}"], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "token", "metadata", "query", "batch-query"], "parameter_names": ["expected_decimals", "expected_name", "expected_symbol", "token_address"], "parameters": "{\"expected_decimals\": {\"description\": \"Expected token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}, \"expected_name\": {\"description\": \"Expected token name\", \"generation\": {\"method\": \"fixed\", \"value\": \"Tether USD\"}, \"type\": \"string\"}, \"expected_symbol\": {\"description\": \"Expected token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"type\": \"string\"}, \"token_address\": {\"description\": \"ERC20 token contract address to query metadata for (USDT on BSC)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"type\": \"address\"}}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query token metadata\", \"field\": \"query_execution\", \"weight\": 25}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"name\", \"symbol\", \"decimals\", \"totalSupply\"], \"weight\": 25}, {\"condition\": \"matches_expected\", \"error_message\": \"Token name does not match expected value\", \"field\": \"name_correctness\", \"weight\": 15}, {\"condition\": \"matches_expected\", \"error_message\": \"Token symbol does not match expected value\", \"field\": \"symbol_correctness\", \"weight\": 15}, {\"condition\": \"matches_expected\", \"error_message\": \"Token decimals do not match expected value\", \"field\": \"decimals_correctness\", \"weight\": 20}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand standard ERC20 token metadata functions\", \"Learn to query multiple contract functions efficiently\", \"Master parsing different return types (string, uint8, uint256)\", \"Understand the importance of decimals in token representation\", \"Learn to handle non-standard ERC20 tokens gracefully\"], \"notes\": [\"name() and symbol() return string values\", \"decimals() returns uint8 (typically 18 for most tokens)\", \"totalSupply() returns uint256 (total token supply in smallest unit)\", \"Some tokens may not implement all functions - handle gracefully\", \"Batch querying is more efficient than individual calls\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_erc20_balance\", \"erc20_transfer_fixed\"], \"tags\": [\"erc20\", \"token\", \"metadata\", \"query\", \"batch-query\"]}", "source_path": "basic_transactions/token_info_queries/query_token_metadata.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"basic_transactions\", \"description\": \"Query comprehensive metadata of an ERC20 token by calling multiple view functions: name(), symbol(), decimals(), and totalSupply(). This demonstrates batch querying capabilities and handling of standard ERC20 token information. Note that some non-standard tokens may not implement all these functions, so proper error handling is important.\", \"difficulty\": \"easy\", \"id\": \"query_token_metadata\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand standard ERC20 token metadata functions\", \"Learn to query multiple contract functions efficiently\", \"Master parsing different return types (string, uint8, uint256)\", \"Understand the importance of decimals in token representation\", \"Learn to handle non-standard ERC20 tokens gracefully\"], \"notes\": [\"name() and symbol() return string values\", \"decimals() returns uint8 (typically 18 for most tokens)\", \"totalSupply() returns uint256 (total token supply in smallest unit)\", \"Some tokens may not implement all functions - handle gracefully\", \"Batch querying is more efficient than individual calls\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_erc20_balance\", \"erc20_transfer_fixed\"], \"tags\": [\"erc20\", \"token\", \"metadata\", \"query\", \"batch-query\"]}, \"natural_language_templates\": [\"Query the metadata for token at {{token_address}} including name, symbol, decimals, and total supply\", \"Get comprehensive information about the ERC20 token at {{token_address}}\", \"Retrieve token details (name, symbol, decimals, totalSupply) for {{token_address}}\", \"Check the basic information of token {{token_address}}\"], \"parameters\": {\"expected_decimals\": {\"description\": \"Expected token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}, \"expected_name\": {\"description\": \"Expected token name\", \"generation\": {\"method\": \"fixed\", \"value\": \"Tether USD\"}, \"type\": \"string\"}, \"expected_symbol\": {\"description\": \"Expected token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"type\": \"string\"}, \"token_address\": {\"description\": \"ERC20 token contract address to query metadata for (USDT on BSC)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"type\": \"address\"}}, \"subcategory\": \"token_info_queries\", \"title\": \"Query Token Metadata\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query token metadata\", \"field\": \"query_execution\", \"weight\": 25}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"name\", \"symbol\", \"decimals\", \"totalSupply\"], \"weight\": 25}, {\"condition\": \"matches_expected\", \"error_message\": \"Token name does not match expected value\", \"field\": \"name_correctness\", \"weight\": 15}, {\"condition\": \"matches_expected\", \"error_message\": \"Token symbol does not match expected value\", \"field\": \"symbol_correctness\", \"weight\": 15}, {\"condition\": \"matches_expected\", \"error_message\": \"Token decimals do not match expected value\", \"field\": \"decimals_correctness\", \"weight\": 20}], \"type\": \"query\"}}"} {"id": "query_token_total_supply", "split": "atomic", "task_type": "atomic", "version": "", "category": "basic_transactions", "subcategory": "token_info_queries", "difficulty": "easy", "title": "Query Token Total Supply", "description": "Query the total supply of an ERC20 token by calling the totalSupply() function. The total supply represents the total amount of tokens that exist, returned in the smallest unit (wei). Understanding decimals is crucial for proper display of the human-readable total supply.", "natural_language_templates": ["Query the total supply of token at {{token_address}}", "Get the total supply for the ERC20 token at {{token_address}} with {{token_decimals}} decimals", "Check how many tokens exist in total for {{token_address}}", "Retrieve the totalSupply of token {{token_address}}"], "chain": "BSC", "network": "mainnet", "tags": ["erc20", "token", "totalSupply", "query", "supply"], "parameter_names": ["token_address", "token_decimals", "token_symbol"], "parameters": "{\"token_address\": {\"description\": \"ERC20 token contract address to query total supply for (USDT on BSC)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals for formatting (USDT uses 18 decimals on BSC)\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"type\": \"string\"}}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query token total supply\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"totalSupply\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"Total supply does not match expected value (allowing 0.1% tolerance for potential changes)\", \"field\": \"total_supply_correctness\", \"tolerance_percent\": 0.1, \"weight\": 30}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the ERC20 totalSupply() function\", \"Learn to query token supply information\", \"Master unit conversion with decimals (wei to token units)\", \"Understand the difference between totalSupply and circulating supply\", \"Learn proper formatting of large numbers\"], \"notes\": [\"totalSupply() returns uint256 in smallest unit (wei)\", \"Must divide by 10^decimals for human-readable format\", \"Total supply may change if token supports minting/burning\", \"Some tokens have fixed supply, others are inflationary/deflationary\", \"Small tolerance (0.1%) allows for potential minting/burning between queries\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_token_metadata\", \"query_erc20_balance\"], \"tags\": [\"erc20\", \"token\", \"totalSupply\", \"query\", \"supply\"]}", "source_path": "basic_transactions/token_info_queries/query_token_total_supply.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"basic_transactions\", \"description\": \"Query the total supply of an ERC20 token by calling the totalSupply() function. The total supply represents the total amount of tokens that exist, returned in the smallest unit (wei). Understanding decimals is crucial for proper display of the human-readable total supply.\", \"difficulty\": \"easy\", \"id\": \"query_token_total_supply\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand the ERC20 totalSupply() function\", \"Learn to query token supply information\", \"Master unit conversion with decimals (wei to token units)\", \"Understand the difference between totalSupply and circulating supply\", \"Learn proper formatting of large numbers\"], \"notes\": [\"totalSupply() returns uint256 in smallest unit (wei)\", \"Must divide by 10^decimals for human-readable format\", \"Total supply may change if token supports minting/burning\", \"Some tokens have fixed supply, others are inflationary/deflationary\", \"Small tolerance (0.1%) allows for potential minting/burning between queries\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_token_metadata\", \"query_erc20_balance\"], \"tags\": [\"erc20\", \"token\", \"totalSupply\", \"query\", \"supply\"]}, \"natural_language_templates\": [\"Query the total supply of token at {{token_address}}\", \"Get the total supply for the ERC20 token at {{token_address}} with {{token_decimals}} decimals\", \"Check how many tokens exist in total for {{token_address}}\", \"Retrieve the totalSupply of token {{token_address}}\"], \"parameters\": {\"token_address\": {\"description\": \"ERC20 token contract address to query total supply for (USDT on BSC)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals for formatting (USDT uses 18 decimals on BSC)\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"type\": \"string\"}}, \"subcategory\": \"token_info_queries\", \"title\": \"Query Token Total Supply\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query token total supply\", \"field\": \"query_execution\", \"weight\": 40}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"totalSupply\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"Total supply does not match expected value (allowing 0.1% tolerance for potential changes)\", \"field\": \"total_supply_correctness\", \"tolerance_percent\": 0.1, \"weight\": 30}], \"type\": \"query\"}}"} {"id": "add_liquidity_bnb_token", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "pancakeswap_liquidity", "difficulty": "medium", "title": "PancakeSwap Add Liquidity - BNB + Token", "description": "Add liquidity to a BNB/Token pair on PancakeSwap V2. IMPORTANT: You must query the pair's current reserves first using Factory.getPair() to get the pair address, then call pair.getReserves() to get reserve amounts. Calculate the optimal token amount using the formula: optimalTokenAmount = (amountBNB × reserveToken) / reserveWBNB. Then calculate amountTokenMin and amountETHMin by applying slippage tolerance (subtract slippage % from desired amounts). Use addLiquidityETH function with these parameters: token address, amountTokenDesired (the optimal amount), amountTokenMin, amountETHMin, recipient address, and deadline. CRITICAL: This is a payable function - you must set the transaction value field to the BNB amount you're adding.", "natural_language_templates": ["Add {amount_bnb} BNB and {amount_token} {token_symbol} as liquidity to PancakeSwap", "Provide liquidity to PancakeSwap: {amount_bnb} BNB + {amount_token} {token_symbol}", "Deposit {amount_bnb} BNB and {amount_token} {token_symbol} into PancakeSwap liquidity pool", "Add liquidity pair on PancakeSwap: {amount_bnb} BNB paired with {amount_token} {token_symbol}"], "chain": "", "network": "bsc", "tags": ["defi", "dex", "liquidity", "pancakeswap", "amm", "lp-token"], "parameter_names": ["amount_bnb", "amount_token", "router_address", "slippage", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"amount_bnb\": {\"description\": \"Amount of BNB to add as liquidity (in BNB, e.g., 0.1)\", \"generation\": {\"decimals\": 3, \"max\": 0.05, \"method\": \"random\", \"min\": 0.01}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"amount_token\": {\"description\": \"Desired amount of tokens to add as liquidity (in human-readable format)\", \"generation\": {\"decimals\": 2, \"max\": 20.0, \"method\": \"random\", \"min\": 5.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router V2 contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Maximum acceptable slippage percentage (e.g., 5.0 for 5%)\", \"generation\": {\"decimals\": 1, \"max\": 10.0, \"method\": \"random\", \"min\": 3.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_address\": {\"description\": \"Token address to pair with BNB\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"address\": \"{router_address}\", \"description\": \"Correct PancakeSwap Router called\", \"type\": \"contract_call\", \"weight\": 0.15}, {\"description\": \"Correct function addLiquidityETH called\", \"selector\": \"0xf305d719\", \"type\": \"function_selector\", \"weight\": 0.15}, {\"description\": \"BNB balance decreased correctly\", \"expected_change\": \"-{amount_bnb}\", \"tolerance\": \"gas_only\", \"type\": \"bnb_balance_decrease\", \"weight\": 0.2}, {\"description\": \"Token balance decreased correctly\", \"expected_change\": \"-{amount_token}\", \"token\": \"{token_address}\", \"tolerance\": \"0.05\", \"type\": \"token_balance_decrease\", \"weight\": 0.1}, {\"description\": \"LP tokens received from liquidity pool\", \"min_increase\": 0, \"type\": \"lp_token_received\", \"weight\": 0.1}], \"pre_conditions\": [{\"description\": \"Test account must have sufficient BNB balance\", \"min_balance\": \"{amount_bnb}\", \"type\": \"balance_check\"}, {\"description\": \"Test account must have sufficient token balance\", \"min_balance\": \"{amount_token}\", \"token\": \"{token_address}\", \"type\": \"token_balance\"}, {\"description\": \"Token must be approved for PancakeSwap Router\", \"spender\": \"{router_address}\", \"token\": \"{token_address}\", \"type\": \"token_approval\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"common_pitfalls\": [\"Not approving token before adding liquidity\", \"Not sending BNB value with the transaction\", \"Setting amountTokenMin/amountETHMin too high\", \"Not accounting for current pool ratio\", \"Forgetting to set deadline parameter\"], \"complexity\": \"medium\", \"estimated_gas\": \"200000-250000\", \"learning_objectives\": [\"Understanding liquidity provision in AMM DEXes\", \"Managing token approvals for router contracts\", \"Handling payable functions with native tokens\", \"Calculating slippage tolerance for liquidity operations\", \"Receiving and tracking LP tokens\"], \"requires_contract\": false, \"requires_native_token\": true, \"tags\": [\"defi\", \"dex\", \"liquidity\", \"pancakeswap\", \"amm\", \"lp-token\"]}", "source_path": "defi_operations/pancakeswap_liquidity/add_liquidity_bnb_token.json", "raw_definition": "{\"blockchain\": {\"contract_address\": \"{{router_address}}\", \"function_name\": \"addLiquidityETH\", \"function_signature\": \"addLiquidityETH(address,uint256,uint256,uint256,address,uint256)\", \"network\": \"bsc\"}, \"category\": \"defi_operations\", \"description\": \"Add liquidity to a BNB/Token pair on PancakeSwap V2. IMPORTANT: You must query the pair's current reserves first using Factory.getPair() to get the pair address, then call pair.getReserves() to get reserve amounts. Calculate the optimal token amount using the formula: optimalTokenAmount = (amountBNB × reserveToken) / reserveWBNB. Then calculate amountTokenMin and amountETHMin by applying slippage tolerance (subtract slippage % from desired amounts). Use addLiquidityETH function with these parameters: token address, amountTokenDesired (the optimal amount), amountTokenMin, amountETHMin, recipient address, and deadline. CRITICAL: This is a payable function - you must set the transaction value field to the BNB amount you're adding.\", \"difficulty\": \"medium\", \"id\": \"add_liquidity_bnb_token\", \"metadata\": {\"common_pitfalls\": [\"Not approving token before adding liquidity\", \"Not sending BNB value with the transaction\", \"Setting amountTokenMin/amountETHMin too high\", \"Not accounting for current pool ratio\", \"Forgetting to set deadline parameter\"], \"complexity\": \"medium\", \"estimated_gas\": \"200000-250000\", \"learning_objectives\": [\"Understanding liquidity provision in AMM DEXes\", \"Managing token approvals for router contracts\", \"Handling payable functions with native tokens\", \"Calculating slippage tolerance for liquidity operations\", \"Receiving and tracking LP tokens\"], \"requires_contract\": false, \"requires_native_token\": true, \"tags\": [\"defi\", \"dex\", \"liquidity\", \"pancakeswap\", \"amm\", \"lp-token\"]}, \"natural_language_templates\": [\"Add {amount_bnb} BNB and {amount_token} {token_symbol} as liquidity to PancakeSwap\", \"Provide liquidity to PancakeSwap: {amount_bnb} BNB + {amount_token} {token_symbol}\", \"Deposit {amount_bnb} BNB and {amount_token} {token_symbol} into PancakeSwap liquidity pool\", \"Add liquidity pair on PancakeSwap: {amount_bnb} BNB paired with {amount_token} {token_symbol}\"], \"parameters\": {\"amount_bnb\": {\"description\": \"Amount of BNB to add as liquidity (in BNB, e.g., 0.1)\", \"generation\": {\"decimals\": 3, \"max\": 0.05, \"method\": \"random\", \"min\": 0.01}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"amount_token\": {\"description\": \"Desired amount of tokens to add as liquidity (in human-readable format)\", \"generation\": {\"decimals\": 2, \"max\": 20.0, \"method\": \"random\", \"min\": 5.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router V2 contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Maximum acceptable slippage percentage (e.g., 5.0 for 5%)\", \"generation\": {\"decimals\": 1, \"max\": 10.0, \"method\": \"random\", \"min\": 3.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_address\": {\"description\": \"Token address to pair with BNB\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}, \"preconditions\": {\"account_balance\": {\"description\": \"Test account must have sufficient BNB balance\", \"minimum_balance_bnb\": \"{{amount_bnb}}\"}, \"liquidity_pool\": {\"description\": \"Liquidity pool for BNB/Token pair should exist\", \"pair\": \"BNB/{{token_symbol}}\"}, \"token_approval\": {\"description\": \"Token must be approved for PancakeSwap Router\", \"minimum_allowance\": \"{{amount_token}}\", \"spender\": \"{{router_address}}\", \"token\": \"{{token_address}}\"}, \"token_balance\": {\"description\": \"Test account must have sufficient token balance\", \"minimum_balance\": \"{{amount_token}}\", \"token\": \"{{token_address}}\"}}, \"subcategory\": \"pancakeswap_liquidity\", \"title\": \"PancakeSwap Add Liquidity - BNB + Token\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"address\": \"{router_address}\", \"description\": \"Correct PancakeSwap Router called\", \"type\": \"contract_call\", \"weight\": 0.15}, {\"description\": \"Correct function addLiquidityETH called\", \"selector\": \"0xf305d719\", \"type\": \"function_selector\", \"weight\": 0.15}, {\"description\": \"BNB balance decreased correctly\", \"expected_change\": \"-{amount_bnb}\", \"tolerance\": \"gas_only\", \"type\": \"bnb_balance_decrease\", \"weight\": 0.2}, {\"description\": \"Token balance decreased correctly\", \"expected_change\": \"-{amount_token}\", \"token\": \"{token_address}\", \"tolerance\": \"0.05\", \"type\": \"token_balance_decrease\", \"weight\": 0.1}, {\"description\": \"LP tokens received from liquidity pool\", \"min_increase\": 0, \"type\": \"lp_token_received\", \"weight\": 0.1}], \"pre_conditions\": [{\"description\": \"Test account must have sufficient BNB balance\", \"min_balance\": \"{amount_bnb}\", \"type\": \"balance_check\"}, {\"description\": \"Test account must have sufficient token balance\", \"min_balance\": \"{amount_token}\", \"token\": \"{token_address}\", \"type\": \"token_balance\"}, {\"description\": \"Token must be approved for PancakeSwap Router\", \"spender\": \"{router_address}\", \"token\": \"{token_address}\", \"type\": \"token_approval\"}]}, \"version\": \"2.0.0\"}"} {"id": "add_liquidity_tokens", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "pancakeswap_liquidity", "difficulty": "medium", "title": "PancakeSwap Add Liquidity - Token + Token", "description": "Add liquidity to a Token/Token pair on PancakeSwap V2. IMPORTANT: You must query the pair's current reserves first using Factory.getPair() to get the pair address, then call pair.getReserves() to get reserve amounts. Determine which token is token0 and which is token1 by calling pair.token0(). Calculate the optimal amount for tokenB using the formula: optimalAmountB = (amountA × reserveB) / reserveA (adjust based on which token you're using as the base). Then calculate amountAMin and amountBMin by applying slippage tolerance (subtract slippage % from desired amounts). CRITICAL: Both tokens must be approved for the Router before calling addLiquidity. Use addLiquidity function with these parameters: tokenA address, tokenB address, amountADesired, amountBDesired, amountAMin, amountBMin, recipient address, and deadline. This is NOT a payable function - do not send BNB value.", "natural_language_templates": ["Add {amount_token_a} {token_a_symbol} and {amount_token_b} {token_b_symbol} as liquidity to PancakeSwap", "Provide liquidity to PancakeSwap: {amount_token_a} {token_a_symbol} + {amount_token_b} {token_b_symbol}", "Deposit {amount_token_a} {token_a_symbol} and {amount_token_b} {token_b_symbol} into PancakeSwap liquidity pool", "Add liquidity pair on PancakeSwap: {amount_token_a} {token_a_symbol} paired with {amount_token_b} {token_b_symbol}"], "chain": "", "network": "bsc", "tags": ["defi", "dex", "liquidity", "pancakeswap", "amm", "lp-token", "token-pair"], "parameter_names": ["amount_token_a", "amount_token_b", "router_address", "slippage", "token_a_address", "token_a_decimals", "token_a_symbol", "token_b_address", "token_b_decimals", "token_b_symbol"], "parameters": "{\"amount_token_a\": {\"description\": \"Desired amount of first token to add as liquidity\", \"generation\": {\"method\": \"fixed\", \"value\": 10.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"amount_token_b\": {\"description\": \"Desired amount of second token to add as liquidity\", \"generation\": {\"method\": \"fixed\", \"value\": 10.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router V2 contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Maximum acceptable slippage percentage (e.g., 5.0 for 5%)\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_a_address\": {\"description\": \"First token address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_a_decimals\": {\"description\": \"First token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_a_symbol\": {\"description\": \"First token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_b_address\": {\"description\": \"Second token address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_b_decimals\": {\"description\": \"Second token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_b_symbol\": {\"description\": \"Second token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [], \"pre_conditions\": [], \"rules\": [{\"description\": \"Transaction must be successfully executed and confirmed\", \"type\": \"transaction_success\"}, {\"description\": \"Both tokens must have been approved for Router (or have existing allowance)\", \"spender\": \"{{router_address}}\", \"tokens\": [\"{{token_a_address}}\", \"{{token_b_address}}\"], \"type\": \"token_approval\"}, {\"contract\": \"{{router_address}}\", \"description\": \"Must interact with PancakeSwap Router contract\", \"type\": \"contract_interaction\"}, {\"description\": \"Must call addLiquidity function\", \"function_selector\": \"0xe8e33700\", \"type\": \"function_call\"}, {\"approximate_amount\": \"{{amount_token_a}}\", \"change\": \"decrease\", \"description\": \"Token A balance must decrease by approximately the specified amount\", \"token\": \"{{token_a_address}}\", \"type\": \"balance_change\"}, {\"approximate_amount\": \"{{amount_token_b}}\", \"change\": \"decrease\", \"description\": \"Token B balance must decrease by approximately the specified amount\", \"token\": \"{{token_b_address}}\", \"type\": \"balance_change\"}, {\"description\": \"Must receive LP tokens from the liquidity pool\", \"minimum_increase\": \"> 0\", \"type\": \"lp_token_received\"}], \"scoring\": {\"correct_function\": 10, \"correct_router\": 10, \"lp_token_increase\": 10, \"token_a_approval\": 10, \"token_a_decrease\": 15, \"token_b_approval\": 10, \"token_b_decrease\": 15, \"transaction_success\": 20}}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"common_pitfalls\": [\"Not approving both tokens before adding liquidity\", \"Using the wrong token order (tokenA vs tokenB)\", \"Setting amountMin values too high based on wrong token\", \"Sending BNB value (this is not a payable function)\", \"Not querying reserves to calculate optimal ratios\", \"Forgetting to set deadline parameter\"], \"complexity\": \"medium\", \"estimated_gas\": \"200000-300000\", \"learning_objectives\": [\"Understanding liquidity provision for token pairs in AMM DEXes\", \"Managing multiple token approvals for router contracts\", \"Calculating optimal amounts based on pool ratios\", \"Handling slippage tolerance for two-sided liquidity\", \"Receiving and tracking LP tokens for token pairs\"], \"requires_contract\": false, \"requires_native_token\": false, \"tags\": [\"defi\", \"dex\", \"liquidity\", \"pancakeswap\", \"amm\", \"lp-token\", \"token-pair\"]}", "source_path": "defi_operations/pancakeswap_liquidity/add_liquidity_tokens.json", "raw_definition": "{\"blockchain\": {\"contract_address\": \"{{router_address}}\", \"function_name\": \"addLiquidity\", \"function_signature\": \"addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)\", \"network\": \"bsc\"}, \"category\": \"defi_operations\", \"description\": \"Add liquidity to a Token/Token pair on PancakeSwap V2. IMPORTANT: You must query the pair's current reserves first using Factory.getPair() to get the pair address, then call pair.getReserves() to get reserve amounts. Determine which token is token0 and which is token1 by calling pair.token0(). Calculate the optimal amount for tokenB using the formula: optimalAmountB = (amountA × reserveB) / reserveA (adjust based on which token you're using as the base). Then calculate amountAMin and amountBMin by applying slippage tolerance (subtract slippage % from desired amounts). CRITICAL: Both tokens must be approved for the Router before calling addLiquidity. Use addLiquidity function with these parameters: tokenA address, tokenB address, amountADesired, amountBDesired, amountAMin, amountBMin, recipient address, and deadline. This is NOT a payable function - do not send BNB value.\", \"difficulty\": \"medium\", \"id\": \"add_liquidity_tokens\", \"metadata\": {\"common_pitfalls\": [\"Not approving both tokens before adding liquidity\", \"Using the wrong token order (tokenA vs tokenB)\", \"Setting amountMin values too high based on wrong token\", \"Sending BNB value (this is not a payable function)\", \"Not querying reserves to calculate optimal ratios\", \"Forgetting to set deadline parameter\"], \"complexity\": \"medium\", \"estimated_gas\": \"200000-300000\", \"learning_objectives\": [\"Understanding liquidity provision for token pairs in AMM DEXes\", \"Managing multiple token approvals for router contracts\", \"Calculating optimal amounts based on pool ratios\", \"Handling slippage tolerance for two-sided liquidity\", \"Receiving and tracking LP tokens for token pairs\"], \"requires_contract\": false, \"requires_native_token\": false, \"tags\": [\"defi\", \"dex\", \"liquidity\", \"pancakeswap\", \"amm\", \"lp-token\", \"token-pair\"]}, \"natural_language_templates\": [\"Add {amount_token_a} {token_a_symbol} and {amount_token_b} {token_b_symbol} as liquidity to PancakeSwap\", \"Provide liquidity to PancakeSwap: {amount_token_a} {token_a_symbol} + {amount_token_b} {token_b_symbol}\", \"Deposit {amount_token_a} {token_a_symbol} and {amount_token_b} {token_b_symbol} into PancakeSwap liquidity pool\", \"Add liquidity pair on PancakeSwap: {amount_token_a} {token_a_symbol} paired with {amount_token_b} {token_b_symbol}\"], \"parameters\": {\"amount_token_a\": {\"description\": \"Desired amount of first token to add as liquidity\", \"generation\": {\"method\": \"fixed\", \"value\": 10.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"amount_token_b\": {\"description\": \"Desired amount of second token to add as liquidity\", \"generation\": {\"method\": \"fixed\", \"value\": 10.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router V2 contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Maximum acceptable slippage percentage (e.g., 5.0 for 5%)\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_a_address\": {\"description\": \"First token address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_a_decimals\": {\"description\": \"First token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_a_symbol\": {\"description\": \"First token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_b_address\": {\"description\": \"Second token address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_b_decimals\": {\"description\": \"Second token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_b_symbol\": {\"description\": \"Second token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"parameter\", \"type\": \"string\"}}, \"preconditions\": {\"liquidity_pool\": {\"description\": \"Liquidity pool for Token A/Token B pair should exist\", \"pair\": \"{{token_a_symbol}}/{{token_b_symbol}}\"}, \"token_a_approval\": {\"description\": \"First token must be approved for PancakeSwap Router\", \"minimum_allowance\": \"{{amount_token_a}}\", \"spender\": \"{{router_address}}\", \"token\": \"{{token_a_address}}\"}, \"token_a_balance\": {\"description\": \"Test account must have sufficient balance of first token\", \"minimum_balance\": \"{{amount_token_a}}\", \"token\": \"{{token_a_address}}\"}, \"token_b_approval\": {\"description\": \"Second token must be approved for PancakeSwap Router\", \"minimum_allowance\": \"{{amount_token_b}}\", \"spender\": \"{{router_address}}\", \"token\": \"{{token_b_address}}\"}, \"token_b_balance\": {\"description\": \"Test account must have sufficient balance of second token\", \"minimum_balance\": \"{{amount_token_b}}\", \"token\": \"{{token_b_address}}\"}}, \"subcategory\": \"pancakeswap_liquidity\", \"title\": \"PancakeSwap Add Liquidity - Token + Token\", \"validation\": {\"post_conditions\": [], \"pre_conditions\": [], \"rules\": [{\"description\": \"Transaction must be successfully executed and confirmed\", \"type\": \"transaction_success\"}, {\"description\": \"Both tokens must have been approved for Router (or have existing allowance)\", \"spender\": \"{{router_address}}\", \"tokens\": [\"{{token_a_address}}\", \"{{token_b_address}}\"], \"type\": \"token_approval\"}, {\"contract\": \"{{router_address}}\", \"description\": \"Must interact with PancakeSwap Router contract\", \"type\": \"contract_interaction\"}, {\"description\": \"Must call addLiquidity function\", \"function_selector\": \"0xe8e33700\", \"type\": \"function_call\"}, {\"approximate_amount\": \"{{amount_token_a}}\", \"change\": \"decrease\", \"description\": \"Token A balance must decrease by approximately the specified amount\", \"token\": \"{{token_a_address}}\", \"type\": \"balance_change\"}, {\"approximate_amount\": \"{{amount_token_b}}\", \"change\": \"decrease\", \"description\": \"Token B balance must decrease by approximately the specified amount\", \"token\": \"{{token_b_address}}\", \"type\": \"balance_change\"}, {\"description\": \"Must receive LP tokens from the liquidity pool\", \"minimum_increase\": \"> 0\", \"type\": \"lp_token_received\"}], \"scoring\": {\"correct_function\": 10, \"correct_router\": 10, \"lp_token_increase\": 10, \"token_a_approval\": 10, \"token_a_decrease\": 15, \"token_b_approval\": 10, \"token_b_decrease\": 15, \"transaction_success\": 20}}, \"version\": \"2.0.0\"}"} {"id": "remove_liquidity_bnb_token", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "pancakeswap_liquidity", "difficulty": "medium", "title": "PancakeSwap Remove Liquidity - BNB + Token", "description": "Remove liquidity from a BNB/Token pair on PancakeSwap V2.\n\nThis task requires:\n1. Query the LP token address for the WBNB/Token pair from PancakeSwap Factory using Factory.getPair(WBNB, token)\n2. Check your current LP token balance using LPToken.balanceOf(agent)\n3. Calculate the liquidity amount to remove based on percentage: liquidity = (balance × percentage) / 100\n4. Query the pair's reserves using Pair.getReserves() and total supply using Pair.totalSupply()\n5. Determine which reserve is WBNB and which is Token by comparing Pair.token0() with addresses\n6. Estimate output amounts: amountToken = (liquidity × reserveToken) / totalSupply, amountETH = (liquidity × reserveWBNB) / totalSupply\n7. Calculate minimum amounts with slippage tolerance: amountTokenMin = estimatedToken × (100 - slippage) / 100, amountETHMin = estimatedETH × (100 - slippage) / 100\n8. Ensure LP tokens are approved for the Router (check allowance and approve if needed)\n9. Call Router.removeLiquidityETH(token, liquidity, amountTokenMin, amountETHMin, to, deadline)\n\nKey PancakeSwap V2 Router function:\n- removeLiquidityETH(address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline) returns (uint amountToken, uint amountETH)\n\nIMPORTANT:\n- This is NOT a payable function - don't send BNB value with the transaction\n- You MUST approve the Router to spend your LP tokens before calling removeLiquidityETH\n- The LP token is the PancakeSwap pair contract for WBNB/Token\n- Use WBNB address (0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c) when querying the Factory\n- Set a reasonable deadline (e.g., current timestamp + 20 minutes)\n- The 'to' address should be the agent's address to receive both Token and BNB\n- After removing liquidity, you'll receive the Token and BNB directly\n\nContract Addresses (BSC Mainnet):\n- PancakeSwap Router V2: 0x10ED43C718714eb63d5aA57B78B54704E256024E\n- PancakeSwap Factory: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73\n- WBNB: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\n\nExample:\n- If you have 2.0 LP tokens and want to remove 50%:\n - liquidity = 2.0 × 0.5 = 1.0 LP tokens\n- If pool has 1000 WBNB, 500,000 USDT, and 100 total LP supply:\n - You'll get: (1.0 × 1000) / 100 = 10 BNB\n - You'll get: (1.0 × 500,000) / 100 = 5,000 USDT\n- With 5% slippage:\n - amountETHMin = 10 × 0.95 = 9.5 BNB\n - amountTokenMin = 5,000 × 0.95 = 4,750 USDT", "natural_language_templates": ["Remove {liquidity_percentage}% of my liquidity from the BNB/{token_symbol} pool on PancakeSwap", "Withdraw liquidity from PancakeSwap: {liquidity_percentage}% from BNB-{token_symbol} pair", "Remove {liquidity_percentage}% LP tokens from the BNB/{token_symbol} liquidity pool"], "chain": "", "network": "bsc", "tags": ["defi", "dex", "liquidity", "pancakeswap", "amm", "lp-token", "remove"], "parameter_names": ["liquidity_percentage", "router_address", "slippage", "token_address", "token_decimals", "token_symbol"], "parameters": "{\"liquidity_percentage\": {\"description\": \"Percentage of LP tokens to remove (0-100)\", \"generation\": {\"method\": \"fixed\", \"value\": 50.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router V2 contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Maximum acceptable slippage percentage (e.g., 5.0 for 5%)\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_address\": {\"description\": \"Token address paired with BNB\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{\"post_conditions\": [], \"pre_conditions\": [], \"rules\": [{\"description\": \"Transaction must be successfully executed and confirmed\", \"type\": \"transaction_success\"}, {\"description\": \"LP token must have been approved for Router\", \"spender\": \"{{router_address}}\", \"type\": \"lp_token_approval\"}, {\"contract\": \"{{router_address}}\", \"description\": \"Must interact with PancakeSwap Router contract\", \"type\": \"contract_interaction\"}, {\"description\": \"Must call removeLiquidityETH function\", \"function_selector\": \"0x02751cec\", \"type\": \"function_call\"}, {\"change\": \"decrease\", \"description\": \"LP token balance must decrease by the removed liquidity amount\", \"type\": \"lp_balance_change\"}, {\"change\": \"increase\", \"description\": \"Token balance must increase (receive tokens from pool)\", \"token\": \"{{token_address}}\", \"type\": \"balance_change\"}, {\"asset\": \"BNB\", \"change\": \"net_increase_expected\", \"description\": \"BNB balance must increase (receive BNB from pool, after gas)\", \"type\": \"balance_change\"}], \"scoring\": {\"bnb_increase\": 15, \"correct_function\": 10, \"correct_router\": 10, \"lp_token_approval\": 10, \"lp_token_decrease\": 20, \"token_increase\": 15, \"transaction_success\": 20}}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"common_pitfalls\": [\"Not approving LP tokens before removing liquidity\", \"Sending BNB value with transaction (this is NOT payable)\", \"Using wrong token address (should use Token, not WBNB)\", \"Setting amountTokenMin/amountETHMin too high\", \"Not querying reserves to estimate output amounts\", \"Forgetting to set deadline parameter\"], \"complexity\": \"medium\", \"estimated_gas\": \"200000-250000\", \"learning_objectives\": [\"Understanding liquidity removal from AMM DEXes\", \"Managing LP token approvals\", \"Calculating liquidity removal amounts and slippage\", \"Handling BNB redemption from WBNB pairs\", \"Multi-step DeFi operations\"], \"requires_contract\": false, \"requires_native_token\": false, \"tags\": [\"defi\", \"dex\", \"liquidity\", \"pancakeswap\", \"amm\", \"lp-token\", \"remove\"]}", "source_path": "defi_operations/pancakeswap_liquidity/remove_liquidity_bnb_token.json", "raw_definition": "{\"blockchain\": {\"contract_address\": \"{{router_address}}\", \"function_name\": \"removeLiquidityETH\", \"function_signature\": \"removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)\", \"network\": \"bsc\"}, \"category\": \"defi_operations\", \"description\": \"Remove liquidity from a BNB/Token pair on PancakeSwap V2.\\n\\nThis task requires:\\n1. Query the LP token address for the WBNB/Token pair from PancakeSwap Factory using Factory.getPair(WBNB, token)\\n2. Check your current LP token balance using LPToken.balanceOf(agent)\\n3. Calculate the liquidity amount to remove based on percentage: liquidity = (balance × percentage) / 100\\n4. Query the pair's reserves using Pair.getReserves() and total supply using Pair.totalSupply()\\n5. Determine which reserve is WBNB and which is Token by comparing Pair.token0() with addresses\\n6. Estimate output amounts: amountToken = (liquidity × reserveToken) / totalSupply, amountETH = (liquidity × reserveWBNB) / totalSupply\\n7. Calculate minimum amounts with slippage tolerance: amountTokenMin = estimatedToken × (100 - slippage) / 100, amountETHMin = estimatedETH × (100 - slippage) / 100\\n8. Ensure LP tokens are approved for the Router (check allowance and approve if needed)\\n9. Call Router.removeLiquidityETH(token, liquidity, amountTokenMin, amountETHMin, to, deadline)\\n\\nKey PancakeSwap V2 Router function:\\n- removeLiquidityETH(address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline) returns (uint amountToken, uint amountETH)\\n\\nIMPORTANT:\\n- This is NOT a payable function - don't send BNB value with the transaction\\n- You MUST approve the Router to spend your LP tokens before calling removeLiquidityETH\\n- The LP token is the PancakeSwap pair contract for WBNB/Token\\n- Use WBNB address (0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c) when querying the Factory\\n- Set a reasonable deadline (e.g., current timestamp + 20 minutes)\\n- The 'to' address should be the agent's address to receive both Token and BNB\\n- After removing liquidity, you'll receive the Token and BNB directly\\n\\nContract Addresses (BSC Mainnet):\\n- PancakeSwap Router V2: 0x10ED43C718714eb63d5aA57B78B54704E256024E\\n- PancakeSwap Factory: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73\\n- WBNB: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\\n\\nExample:\\n- If you have 2.0 LP tokens and want to remove 50%:\\n - liquidity = 2.0 × 0.5 = 1.0 LP tokens\\n- If pool has 1000 WBNB, 500,000 USDT, and 100 total LP supply:\\n - You'll get: (1.0 × 1000) / 100 = 10 BNB\\n - You'll get: (1.0 × 500,000) / 100 = 5,000 USDT\\n- With 5% slippage:\\n - amountETHMin = 10 × 0.95 = 9.5 BNB\\n - amountTokenMin = 5,000 × 0.95 = 4,750 USDT\", \"difficulty\": \"medium\", \"id\": \"remove_liquidity_bnb_token\", \"metadata\": {\"common_pitfalls\": [\"Not approving LP tokens before removing liquidity\", \"Sending BNB value with transaction (this is NOT payable)\", \"Using wrong token address (should use Token, not WBNB)\", \"Setting amountTokenMin/amountETHMin too high\", \"Not querying reserves to estimate output amounts\", \"Forgetting to set deadline parameter\"], \"complexity\": \"medium\", \"estimated_gas\": \"200000-250000\", \"learning_objectives\": [\"Understanding liquidity removal from AMM DEXes\", \"Managing LP token approvals\", \"Calculating liquidity removal amounts and slippage\", \"Handling BNB redemption from WBNB pairs\", \"Multi-step DeFi operations\"], \"requires_contract\": false, \"requires_native_token\": false, \"tags\": [\"defi\", \"dex\", \"liquidity\", \"pancakeswap\", \"amm\", \"lp-token\", \"remove\"]}, \"natural_language_templates\": [\"Remove {liquidity_percentage}% of my liquidity from the BNB/{token_symbol} pool on PancakeSwap\", \"Withdraw liquidity from PancakeSwap: {liquidity_percentage}% from BNB-{token_symbol} pair\", \"Remove {liquidity_percentage}% LP tokens from the BNB/{token_symbol} liquidity pool\"], \"parameters\": {\"liquidity_percentage\": {\"description\": \"Percentage of LP tokens to remove (0-100)\", \"generation\": {\"method\": \"fixed\", \"value\": 50.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router V2 contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Maximum acceptable slippage percentage (e.g., 5.0 for 5%)\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_address\": {\"description\": \"Token address paired with BNB\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}}, \"preconditions\": {\"lp_token_approval\": {\"description\": \"LP tokens should be approved for PancakeSwap Router\", \"spender\": \"{{router_address}}\"}, \"lp_token_balance\": {\"description\": \"Test account must have LP tokens for BNB/Token pair\", \"minimum_balance\": \"> 0\"}}, \"subcategory\": \"pancakeswap_liquidity\", \"title\": \"PancakeSwap Remove Liquidity - BNB + Token\", \"validation\": {\"post_conditions\": [], \"pre_conditions\": [], \"rules\": [{\"description\": \"Transaction must be successfully executed and confirmed\", \"type\": \"transaction_success\"}, {\"description\": \"LP token must have been approved for Router\", \"spender\": \"{{router_address}}\", \"type\": \"lp_token_approval\"}, {\"contract\": \"{{router_address}}\", \"description\": \"Must interact with PancakeSwap Router contract\", \"type\": \"contract_interaction\"}, {\"description\": \"Must call removeLiquidityETH function\", \"function_selector\": \"0x02751cec\", \"type\": \"function_call\"}, {\"change\": \"decrease\", \"description\": \"LP token balance must decrease by the removed liquidity amount\", \"type\": \"lp_balance_change\"}, {\"change\": \"increase\", \"description\": \"Token balance must increase (receive tokens from pool)\", \"token\": \"{{token_address}}\", \"type\": \"balance_change\"}, {\"asset\": \"BNB\", \"change\": \"net_increase_expected\", \"description\": \"BNB balance must increase (receive BNB from pool, after gas)\", \"type\": \"balance_change\"}], \"scoring\": {\"bnb_increase\": 15, \"correct_function\": 10, \"correct_router\": 10, \"lp_token_approval\": 10, \"lp_token_decrease\": 20, \"token_increase\": 15, \"transaction_success\": 20}}, \"version\": \"2.0.0\"}"} {"id": "remove_liquidity_tokens", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "pancakeswap_liquidity", "difficulty": "medium", "title": "Remove Liquidity from Token-Token Pool", "description": "Remove liquidity from a PancakeSwap V2 pool with two ERC20 tokens (Token A + Token B).\n\nThis task requires:\n1. Query the LP token address for the Token A/Token B pair from PancakeSwap Factory\n2. Check current LP token balance\n3. Calculate the liquidity amount to remove (can be a fixed amount or percentage)\n4. Query the pair's reserves to estimate how many Token A and Token B you'll receive\n5. Calculate minimum amounts (amountAMin, amountBMin) with slippage protection\n6. Ensure LP tokens are approved for the Router\n7. Call removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline)\n\nKey PancakeSwap V2 Router function:\n- removeLiquidity(address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline) returns (uint amountA, uint amountB)\n\nImportant:\n- You need to APPROVE the Router to spend your LP tokens before calling removeLiquidity\n- Use Factory.getPair(tokenA, tokenB) to get the LP token address\n- Use Pair.getReserves() to estimate output amounts\n- Calculate minimum amounts: amountMin = (estimatedAmount * (100 - slippage)) / 100\n- Set a reasonable deadline (e.g., 20 minutes from now)\n- The 'to' address should be the agent's address to receive the tokens\n\nContract Addresses (BSC Mainnet):\n- PancakeSwap Router V2: 0x10ED43C718714eb63d5aA57B78B54704E256024E\n- PancakeSwap Factory: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73\n\nSteps:\n1. Get the LP token address: Factory.getPair(tokenA, tokenB)\n2. Check LP balance: LPToken.balanceOf(agent)\n3. Approve LP tokens: LPToken.approve(Router, liquidity)\n4. Get pair reserves: Pair.getReserves() and Pair.totalSupply()\n5. Estimate outputs: amountA = (liquidity * reserveA) / totalSupply, similar for amountB\n6. Calculate mins with slippage: amountAMin = amountA * (100 - slippage%) / 100\n7. Call Router.removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, agent, deadline)\n\nExample calculation:\n- If you have 1.5 LP tokens and want to remove 50%:\n - liquidity = 1.5 * 0.5 = 0.75 LP tokens\n- If pool has 1000 Token A, 2000 Token B, 10 total LP supply:\n - You'll get: (0.75 * 1000) / 10 = 75 Token A\n - You'll get: (0.75 * 2000) / 10 = 150 Token B\n- With 5% slippage:\n - amountAMin = 75 * 0.95 = 71.25\n - amountBMin = 150 * 0.95 = 142.5", "natural_language_templates": ["Remove liquidity from the {token_a_symbol}/{token_b_symbol} pool on PancakeSwap", "Withdraw {liquidity_percentage}% of my liquidity from the {token_a_symbol}-{token_b_symbol} pool", "Remove {liquidity_amount} LP tokens from the {token_a_symbol}/{token_b_symbol} pool"], "chain": "", "network": "bsc_mainnet", "tags": ["defi", "pancakeswap", "liquidity", "remove", "amm", "dex"], "parameter_names": ["liquidity_percentage", "router_address", "slippage", "token_a_address", "token_a_decimals", "token_a_symbol", "token_b_address", "token_b_decimals", "token_b_symbol"], "parameters": "{\"liquidity_percentage\": {\"description\": \"Percentage of LP tokens to remove (0-100)\", \"generation\": {\"method\": \"fixed\", \"value\": 50.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router V2 address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Slippage tolerance in percentage\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_a_address\": {\"description\": \"First token address (e.g., USDT)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_a_decimals\": {\"description\": \"First token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_a_symbol\": {\"description\": \"First token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_b_address\": {\"description\": \"Second token address (e.g., BUSD)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_b_decimals\": {\"description\": \"Second token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_b_symbol\": {\"description\": \"Second token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"parameter\", \"type\": \"string\"}}", "validation": "{\"expected_state_changes\": [{\"description\": \"LP token balance should decrease by liquidity amount\", \"type\": \"lp_balance_decrease\"}, {\"description\": \"Token A balance should increase\", \"type\": \"token_a_increase\"}, {\"description\": \"Token B balance should increase\", \"type\": \"token_b_increase\"}], \"post_conditions\": [], \"pre_conditions\": [], \"required_interactions\": [{\"contract\": \"PancakeSwap Router V2\", \"function\": \"removeLiquidity\", \"selector\": \"0xbaa2abde\"}], \"transaction_success\": true}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"approval_spender\": \"PancakeSwap Router V2\", \"approval_target\": \"LP Token\", \"estimated_gas\": 200000, \"learning_objectives\": [\"Understanding liquidity removal from AMM pools\", \"LP token mechanics and redemption\", \"Slippage protection for liquidity removal\", \"Multi-step DeFi operations (query, approve, remove)\"], \"requires_approval\": true, \"requires_contract\": false, \"tags\": [\"defi\", \"pancakeswap\", \"liquidity\", \"remove\", \"amm\", \"dex\"]}", "source_path": "defi_operations/pancakeswap_liquidity/remove_liquidity_tokens.json", "raw_definition": "{\"blockchain\": {\"contracts\": [{\"address\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"functions\": [\"removeLiquidity(address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline)\"], \"name\": \"PancakeSwap Router V2\"}, {\"address\": \"0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73\", \"functions\": [\"getPair(address tokenA, address tokenB)\"], \"name\": \"PancakeSwap Factory\"}], \"network\": \"bsc_mainnet\"}, \"category\": \"defi_operations\", \"description\": \"Remove liquidity from a PancakeSwap V2 pool with two ERC20 tokens (Token A + Token B).\\n\\nThis task requires:\\n1. Query the LP token address for the Token A/Token B pair from PancakeSwap Factory\\n2. Check current LP token balance\\n3. Calculate the liquidity amount to remove (can be a fixed amount or percentage)\\n4. Query the pair's reserves to estimate how many Token A and Token B you'll receive\\n5. Calculate minimum amounts (amountAMin, amountBMin) with slippage protection\\n6. Ensure LP tokens are approved for the Router\\n7. Call removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline)\\n\\nKey PancakeSwap V2 Router function:\\n- removeLiquidity(address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline) returns (uint amountA, uint amountB)\\n\\nImportant:\\n- You need to APPROVE the Router to spend your LP tokens before calling removeLiquidity\\n- Use Factory.getPair(tokenA, tokenB) to get the LP token address\\n- Use Pair.getReserves() to estimate output amounts\\n- Calculate minimum amounts: amountMin = (estimatedAmount * (100 - slippage)) / 100\\n- Set a reasonable deadline (e.g., 20 minutes from now)\\n- The 'to' address should be the agent's address to receive the tokens\\n\\nContract Addresses (BSC Mainnet):\\n- PancakeSwap Router V2: 0x10ED43C718714eb63d5aA57B78B54704E256024E\\n- PancakeSwap Factory: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73\\n\\nSteps:\\n1. Get the LP token address: Factory.getPair(tokenA, tokenB)\\n2. Check LP balance: LPToken.balanceOf(agent)\\n3. Approve LP tokens: LPToken.approve(Router, liquidity)\\n4. Get pair reserves: Pair.getReserves() and Pair.totalSupply()\\n5. Estimate outputs: amountA = (liquidity * reserveA) / totalSupply, similar for amountB\\n6. Calculate mins with slippage: amountAMin = amountA * (100 - slippage%) / 100\\n7. Call Router.removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, agent, deadline)\\n\\nExample calculation:\\n- If you have 1.5 LP tokens and want to remove 50%:\\n - liquidity = 1.5 * 0.5 = 0.75 LP tokens\\n- If pool has 1000 Token A, 2000 Token B, 10 total LP supply:\\n - You'll get: (0.75 * 1000) / 10 = 75 Token A\\n - You'll get: (0.75 * 2000) / 10 = 150 Token B\\n- With 5% slippage:\\n - amountAMin = 75 * 0.95 = 71.25\\n - amountBMin = 150 * 0.95 = 142.5\", \"difficulty\": \"medium\", \"id\": \"remove_liquidity_tokens\", \"metadata\": {\"approval_spender\": \"PancakeSwap Router V2\", \"approval_target\": \"LP Token\", \"estimated_gas\": 200000, \"learning_objectives\": [\"Understanding liquidity removal from AMM pools\", \"LP token mechanics and redemption\", \"Slippage protection for liquidity removal\", \"Multi-step DeFi operations (query, approve, remove)\"], \"requires_approval\": true, \"requires_contract\": false, \"tags\": [\"defi\", \"pancakeswap\", \"liquidity\", \"remove\", \"amm\", \"dex\"]}, \"natural_language_templates\": [\"Remove liquidity from the {token_a_symbol}/{token_b_symbol} pool on PancakeSwap\", \"Withdraw {liquidity_percentage}% of my liquidity from the {token_a_symbol}-{token_b_symbol} pool\", \"Remove {liquidity_amount} LP tokens from the {token_a_symbol}/{token_b_symbol} pool\"], \"parameters\": {\"liquidity_percentage\": {\"description\": \"Percentage of LP tokens to remove (0-100)\", \"generation\": {\"method\": \"fixed\", \"value\": 50.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router V2 address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Slippage tolerance in percentage\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_a_address\": {\"description\": \"First token address (e.g., USDT)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_a_decimals\": {\"description\": \"First token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_a_symbol\": {\"description\": \"First token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_b_address\": {\"description\": \"Second token address (e.g., BUSD)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_b_decimals\": {\"description\": \"Second token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_b_symbol\": {\"description\": \"Second token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"parameter\", \"type\": \"string\"}}, \"preconditions\": [{\"check\": \"balance >= 0.01 BNB\", \"description\": \"Must have BNB for gas fees\", \"type\": \"balance\"}, {\"check\": \"LP token balance > 0\", \"description\": \"Must own LP tokens for the pair\", \"type\": \"lp_balance\"}], \"subcategory\": \"pancakeswap_liquidity\", \"title\": \"Remove Liquidity from Token-Token Pool\", \"validation\": {\"expected_state_changes\": [{\"description\": \"LP token balance should decrease by liquidity amount\", \"type\": \"lp_balance_decrease\"}, {\"description\": \"Token A balance should increase\", \"type\": \"token_a_increase\"}, {\"description\": \"Token B balance should increase\", \"type\": \"token_b_increase\"}], \"post_conditions\": [], \"pre_conditions\": [], \"required_interactions\": [{\"contract\": \"PancakeSwap Router V2\", \"function\": \"removeLiquidity\", \"selector\": \"0xbaa2abde\"}], \"transaction_success\": true}, \"version\": \"2.0.0\"}"} {"id": "query_pair_reserves", "split": "atomic", "task_type": "atomic", "version": "", "category": "defi_operations", "subcategory": "pancakeswap_queries", "difficulty": "easy", "title": "Query PancakeSwap Pair Reserves", "description": "Query the reserve amounts of both tokens in a PancakeSwap liquidity pair", "natural_language_templates": ["Get the reserves of the {token0_symbol}/{token1_symbol} pair at {pair_address}", "Query the liquidity reserves for pair {pair_address}", "Check the reserve0 and reserve1 for the PancakeSwap pair {pair_address}", "What are the current reserves of the {token0_symbol}/{token1_symbol} liquidity pair?"], "chain": "BSC", "network": "mainnet", "tags": ["query", "defi", "pancakeswap", "liquidity", "reserves", "read-only"], "parameter_names": ["pair_address", "token0_address", "token0_decimals", "token0_symbol", "token1_address", "token1_decimals", "token1_symbol"], "parameters": "{\"pair_address\": {\"description\": \"PancakeSwap pair contract address\", \"generation\": {\"comment\": \"USDT/BUSD LP pair on BSC\", \"method\": \"fixed\", \"value\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token0_address\": {\"description\": \"Token0 address in the pair\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"USDT is token0 in USDT/BUSD pair\", \"method\": \"from_list\"}, \"role\": \"reference\", \"type\": \"address\"}, \"token0_decimals\": {\"description\": \"Token0 decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token0_symbol\": {\"description\": \"Token0 symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"token1_address\": {\"description\": \"Token1 address in the pair\", \"generation\": {\"addresses\": [\"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"], \"comment\": \"BUSD is token1 in USDT/BUSD pair\", \"method\": \"from_list\"}, \"role\": \"reference\", \"type\": \"address\"}, \"token1_decimals\": {\"description\": \"Token1 decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token1_symbol\": {\"description\": \"Token1 symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"display\", \"type\": \"string\"}}", "validation": "{\"checks\": [{\"description\": \"Query executed successfully\", \"name\": \"query_execution\", \"points\": 30}, {\"description\": \"Return format correct (includes reserve0, reserve1, blockTimestampLast)\", \"name\": \"return_format\", \"points\": 30}, {\"description\": \"Reserve values match actual on-chain data\", \"name\": \"reserves_correctness\", \"points\": 40}], \"type\": \"query_validation\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_type\": \"pancakeswap_pair\", \"estimated_gas\": 30000, \"learning_objectives\": [\"Query PancakeSwap pair reserves using getReserves()\", \"Understand liquidity pool reserve structure\", \"Distinguish between token0 and token1\", \"Handle tuple return values (reserve0, reserve1, blockTimestampLast)\"], \"operation_type\": \"query\", \"requires_contract\": true, \"requires_native_token\": false, \"tags\": [\"query\", \"defi\", \"pancakeswap\", \"liquidity\", \"reserves\", \"read-only\"]}", "source_path": "defi_operations/pancakeswap_queries/query_pair_reserves.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"defi_operations\", \"description\": \"Query the reserve amounts of both tokens in a PancakeSwap liquidity pair\", \"difficulty\": \"easy\", \"id\": \"query_pair_reserves\", \"metadata\": {\"contract_type\": \"pancakeswap_pair\", \"estimated_gas\": 30000, \"learning_objectives\": [\"Query PancakeSwap pair reserves using getReserves()\", \"Understand liquidity pool reserve structure\", \"Distinguish between token0 and token1\", \"Handle tuple return values (reserve0, reserve1, blockTimestampLast)\"], \"operation_type\": \"query\", \"requires_contract\": true, \"requires_native_token\": false, \"tags\": [\"query\", \"defi\", \"pancakeswap\", \"liquidity\", \"reserves\", \"read-only\"]}, \"natural_language_templates\": [\"Get the reserves of the {token0_symbol}/{token1_symbol} pair at {pair_address}\", \"Query the liquidity reserves for pair {pair_address}\", \"Check the reserve0 and reserve1 for the PancakeSwap pair {pair_address}\", \"What are the current reserves of the {token0_symbol}/{token1_symbol} liquidity pair?\"], \"parameters\": {\"pair_address\": {\"description\": \"PancakeSwap pair contract address\", \"generation\": {\"comment\": \"USDT/BUSD LP pair on BSC\", \"method\": \"fixed\", \"value\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token0_address\": {\"description\": \"Token0 address in the pair\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"USDT is token0 in USDT/BUSD pair\", \"method\": \"from_list\"}, \"role\": \"reference\", \"type\": \"address\"}, \"token0_decimals\": {\"description\": \"Token0 decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token0_symbol\": {\"description\": \"Token0 symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"token1_address\": {\"description\": \"Token1 address in the pair\", \"generation\": {\"addresses\": [\"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"], \"comment\": \"BUSD is token1 in USDT/BUSD pair\", \"method\": \"from_list\"}, \"role\": \"reference\", \"type\": \"address\"}, \"token1_decimals\": {\"description\": \"Token1 decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token1_symbol\": {\"description\": \"Token1 symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"display\", \"type\": \"string\"}}, \"subcategory\": \"pancakeswap_queries\", \"title\": \"Query PancakeSwap Pair Reserves\", \"validation\": {\"checks\": [{\"description\": \"Query executed successfully\", \"name\": \"query_execution\", \"points\": 30}, {\"description\": \"Return format correct (includes reserve0, reserve1, blockTimestampLast)\", \"name\": \"return_format\", \"points\": 30}, {\"description\": \"Reserve values match actual on-chain data\", \"name\": \"reserves_correctness\", \"points\": 40}], \"type\": \"query_validation\"}}"} {"id": "query_swap_input_amount", "split": "atomic", "task_type": "atomic", "version": "", "category": "defi_operations", "subcategory": "pancakeswap_queries", "difficulty": "medium", "title": "Query Swap Input Amount", "description": "Calculate the required input amount to achieve a target output amount before executing a swap on PancakeSwap. This involves calling the Router's getAmountsIn function with the desired output amount and token path.", "natural_language_templates": ["Query how much {{token_in_symbol}} is needed to get exactly {{amount_out}} {{token_out_symbol}} on PancakeSwap", "Calculate the input amount required to receive {{amount_out}} {{token_out_symbol}} when swapping from {{token_in_symbol}}", "Check how much {{token_in_symbol}} tokens are needed to get {{amount_out}} {{token_out_symbol}} via PancakeSwap Router at {{router_address}}", "Get the required input amount for swapping to receive exactly {{amount_out}} {{token_out_symbol}}, starting from {{token_in_symbol}}"], "chain": "BSC", "network": "mainnet", "tags": ["defi", "pancakeswap", "swap", "query", "router", "getAmountsIn"], "parameter_names": ["amount_out", "router_address", "token_in_address", "token_in_decimals", "token_in_symbol", "token_out_address", "token_out_decimals", "token_out_symbol"], "parameters": "{\"amount_out\": {\"description\": \"Desired output amount (in token units, not wei)\", \"generation\": {\"decimals\": 2, \"max\": 100, \"method\": \"random\", \"min\": 10}, \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap V2 Router address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"type\": \"address\"}, \"token_in_address\": {\"description\": \"Input token address (USDT)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"type\": \"address\"}, \"token_in_decimals\": {\"description\": \"Input token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}, \"token_in_symbol\": {\"description\": \"Input token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"type\": \"string\"}, \"token_out_address\": {\"description\": \"Output token address (BUSD)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"type\": \"address\"}, \"token_out_decimals\": {\"description\": \"Output token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}, \"token_out_symbol\": {\"description\": \"Output token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"type\": \"string\"}}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query swap input amount\", \"field\": \"query_execution\", \"weight\": 30}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"amounts\", \"amount_in\", \"amount_out\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"Input amount does not match expected value\", \"field\": \"input_amount_correctness\", \"tolerance_percent\": 1, \"weight\": 40}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand how to use PancakeSwap Router's getAmountsIn function\", \"Learn to calculate required input amount for a target output\", \"Master reverse swap calculation with path arrays\", \"Understand the importance of slippage consideration in DeFi swaps\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_swap_output_amount\", \"query_pair_reserves\"], \"tags\": [\"defi\", \"pancakeswap\", \"swap\", \"query\", \"router\", \"getAmountsIn\"]}", "source_path": "defi_operations/pancakeswap_queries/query_swap_input_amount.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"defi_operations\", \"description\": \"Calculate the required input amount to achieve a target output amount before executing a swap on PancakeSwap. This involves calling the Router's getAmountsIn function with the desired output amount and token path.\", \"difficulty\": \"medium\", \"id\": \"query_swap_input_amount\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand how to use PancakeSwap Router's getAmountsIn function\", \"Learn to calculate required input amount for a target output\", \"Master reverse swap calculation with path arrays\", \"Understand the importance of slippage consideration in DeFi swaps\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"query_swap_output_amount\", \"query_pair_reserves\"], \"tags\": [\"defi\", \"pancakeswap\", \"swap\", \"query\", \"router\", \"getAmountsIn\"]}, \"natural_language_templates\": [\"Query how much {{token_in_symbol}} is needed to get exactly {{amount_out}} {{token_out_symbol}} on PancakeSwap\", \"Calculate the input amount required to receive {{amount_out}} {{token_out_symbol}} when swapping from {{token_in_symbol}}\", \"Check how much {{token_in_symbol}} tokens are needed to get {{amount_out}} {{token_out_symbol}} via PancakeSwap Router at {{router_address}}\", \"Get the required input amount for swapping to receive exactly {{amount_out}} {{token_out_symbol}}, starting from {{token_in_symbol}}\"], \"parameters\": {\"amount_out\": {\"description\": \"Desired output amount (in token units, not wei)\", \"generation\": {\"decimals\": 2, \"max\": 100, \"method\": \"random\", \"min\": 10}, \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap V2 Router address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"type\": \"address\"}, \"token_in_address\": {\"description\": \"Input token address (USDT)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"type\": \"address\"}, \"token_in_decimals\": {\"description\": \"Input token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}, \"token_in_symbol\": {\"description\": \"Input token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"type\": \"string\"}, \"token_out_address\": {\"description\": \"Output token address (BUSD)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"type\": \"address\"}, \"token_out_decimals\": {\"description\": \"Output token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}, \"token_out_symbol\": {\"description\": \"Output token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"type\": \"string\"}}, \"subcategory\": \"pancakeswap_queries\", \"title\": \"Query Swap Input Amount\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query swap input amount\", \"field\": \"query_execution\", \"weight\": 30}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"amounts\", \"amount_in\", \"amount_out\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"Input amount does not match expected value\", \"field\": \"input_amount_correctness\", \"tolerance_percent\": 1, \"weight\": 40}], \"type\": \"query\"}}"} {"id": "query_swap_output_amount", "split": "atomic", "task_type": "atomic", "version": "", "category": "defi_operations", "subcategory": "pancakeswap_queries", "difficulty": "medium", "title": "Query Swap Output Amount", "description": "Query the expected output amount for a token swap before executing the trade", "natural_language_templates": ["Calculate how much {token_out_symbol} you will receive for {amount_in} {token_in_symbol} on PancakeSwap", "Query the output amount for swapping {amount_in} {token_in_symbol} to {token_out_symbol}", "Get the estimated output for a {token_in_symbol} to {token_out_symbol} swap with input amount {amount_in}", "What is the expected output for swapping {amount_in} {token_in_symbol} for {token_out_symbol}?"], "chain": "BSC", "network": "mainnet", "tags": ["query", "defi", "pancakeswap", "swap", "price", "read-only"], "parameter_names": ["amount_in", "router_address", "token_in_address", "token_in_decimals", "token_in_symbol", "token_out_address", "token_out_decimals", "token_out_symbol"], "parameters": "{\"amount_in\": {\"description\": \"Input amount in tokens\", \"generation\": {\"comment\": \"Random input amount between 10-100 tokens\", \"decimals\": 2, \"max\": 100, \"method\": \"random\", \"min\": 10}, \"role\": \"parameter\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router contract address\", \"generation\": {\"comment\": \"PancakeSwap Router V2\", \"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_in_address\": {\"description\": \"Input token address\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"USDT as input token\", \"method\": \"from_list\"}, \"role\": \"parameter\", \"type\": \"address\"}, \"token_in_decimals\": {\"description\": \"Input token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_in_symbol\": {\"description\": \"Input token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"token_out_address\": {\"description\": \"Output token address\", \"generation\": {\"addresses\": [\"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"], \"comment\": \"BUSD as output token\", \"method\": \"from_list\"}, \"role\": \"parameter\", \"type\": \"address\"}, \"token_out_decimals\": {\"description\": \"Output token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_out_symbol\": {\"description\": \"Output token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"display\", \"type\": \"string\"}}", "validation": "{\"checks\": [{\"description\": \"Query executed successfully\", \"name\": \"query_execution\", \"points\": 30}, {\"description\": \"Return format correct (includes amounts array)\", \"name\": \"return_format\", \"points\": 30}, {\"description\": \"Output amount matches expected value from router\", \"name\": \"output_amount_correctness\", \"points\": 40}], \"type\": \"query_validation\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_type\": \"pancakeswap_router\", \"estimated_gas\": 50000, \"learning_objectives\": [\"Query swap output amounts using getAmountsOut()\", \"Understand swap path array structure\", \"Parse array return values from smart contracts\", \"Calculate expected output before executing trades\"], \"operation_type\": \"query\", \"requires_contract\": true, \"requires_native_token\": false, \"tags\": [\"query\", \"defi\", \"pancakeswap\", \"swap\", \"price\", \"read-only\"]}", "source_path": "defi_operations/pancakeswap_queries/query_swap_output_amount.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"defi_operations\", \"description\": \"Query the expected output amount for a token swap before executing the trade\", \"difficulty\": \"medium\", \"id\": \"query_swap_output_amount\", \"metadata\": {\"contract_type\": \"pancakeswap_router\", \"estimated_gas\": 50000, \"learning_objectives\": [\"Query swap output amounts using getAmountsOut()\", \"Understand swap path array structure\", \"Parse array return values from smart contracts\", \"Calculate expected output before executing trades\"], \"operation_type\": \"query\", \"requires_contract\": true, \"requires_native_token\": false, \"tags\": [\"query\", \"defi\", \"pancakeswap\", \"swap\", \"price\", \"read-only\"]}, \"natural_language_templates\": [\"Calculate how much {token_out_symbol} you will receive for {amount_in} {token_in_symbol} on PancakeSwap\", \"Query the output amount for swapping {amount_in} {token_in_symbol} to {token_out_symbol}\", \"Get the estimated output for a {token_in_symbol} to {token_out_symbol} swap with input amount {amount_in}\", \"What is the expected output for swapping {amount_in} {token_in_symbol} for {token_out_symbol}?\"], \"parameters\": {\"amount_in\": {\"description\": \"Input amount in tokens\", \"generation\": {\"comment\": \"Random input amount between 10-100 tokens\", \"decimals\": 2, \"max\": 100, \"method\": \"random\", \"min\": 10}, \"role\": \"parameter\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router contract address\", \"generation\": {\"comment\": \"PancakeSwap Router V2\", \"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"contract\", \"type\": \"address\"}, \"token_in_address\": {\"description\": \"Input token address\", \"generation\": {\"addresses\": [\"0x55d398326f99059fF775485246999027B3197955\"], \"comment\": \"USDT as input token\", \"method\": \"from_list\"}, \"role\": \"parameter\", \"type\": \"address\"}, \"token_in_decimals\": {\"description\": \"Input token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_in_symbol\": {\"description\": \"Input token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"token_out_address\": {\"description\": \"Output token address\", \"generation\": {\"addresses\": [\"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"], \"comment\": \"BUSD as output token\", \"method\": \"from_list\"}, \"role\": \"parameter\", \"type\": \"address\"}, \"token_out_decimals\": {\"description\": \"Output token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_out_symbol\": {\"description\": \"Output token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"display\", \"type\": \"string\"}}, \"subcategory\": \"pancakeswap_queries\", \"title\": \"Query Swap Output Amount\", \"validation\": {\"checks\": [{\"description\": \"Query executed successfully\", \"name\": \"query_execution\", \"points\": 30}, {\"description\": \"Return format correct (includes amounts array)\", \"name\": \"return_format\", \"points\": 30}, {\"description\": \"Output amount matches expected value from router\", \"name\": \"output_amount_correctness\", \"points\": 40}], \"type\": \"query_validation\"}}"} {"id": "swap_exact_bnb_for_tokens", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "pancakeswap_swap", "difficulty": "easy", "title": "PancakeSwap Swap - BNB to Token", "description": "Swap BNB for ERC20 tokens using PancakeSwap V2 Router's swapExactETHForTokens function.\n\nTechnical context:\n- PancakeSwap V2 Router (BSC Mainnet): 0x10ED43C718714eb63d5aA57B78B54704E256024E\n- Function signature: swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts)\n- This is a payable function that requires sending BNB with the transaction\n- The swap follows Uniswap V2 AMM (Automated Market Maker) model: x * y = k\n- Function selector: 0x7ff36ab5\n- Recommended gas limit: 200000\n\nKey considerations:\n- amountOutMin: Minimum amount of tokens to receive (slippage protection)\n- path: Array of token addresses for the swap route [WBNB, TOKEN]\n- to: Recipient address (usually the sender/agent address)\n- deadline: Unix timestamp after which the transaction will revert\n- Must set transaction 'value' field to the BNB amount being swapped\n- WBNB address on BSC: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\n\nSlippage protection:\n- Calculate amountOutMin using getAmountsOut or apply a percentage (2-5% typical)\n- Formula: amountOutMin = expectedOutput * (1 - slippagePercent)\n- For testing, can use 0 for amountOutMin (accepts any output)\n\nSuccess criteria:\n- Transaction executes successfully\n- Correct PancakeSwap Router is called\n- BNB balance decreases by amountIn (plus gas)\n- Token balance increases by at least amountOutMin", "natural_language_templates": ["Swap {amount_in} BNB for {token_symbol} tokens on PancakeSwap", "Exchange {amount_in} BNB to {token_symbol} using PancakeSwap Router", "Convert {amount_in} BNB to {token_symbol} tokens through PancakeSwap V2", "Trade {amount_in} BNB for {token_symbol} on PancakeSwap with {slippage}% slippage tolerance"], "chain": "BSC", "network": "mainnet", "tags": ["pancakeswap", "swap", "dex", "amm", "defi", "bnb-to-token"], "parameter_names": ["amount_in", "router_address", "slippage", "token_address", "token_decimals", "token_symbol", "wbnb_address"], "parameters": "{\"amount_in\": {\"description\": \"Amount of BNB to swap\", \"generation\": {\"decimals\": 4, \"max\": 0.01, \"method\": \"random\", \"min\": 0.001}, \"role\": \"swap_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"router_address\": {\"description\": \"PancakeSwap V2 Router contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"contract\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Slippage tolerance percentage\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"slippage_tolerance\", \"type\": \"number\", \"unit\": \"percent\"}, \"token_address\": {\"description\": \"Target token to receive (USDT by default)\", \"generation\": {\"comment\": \"USDT on BSC\", \"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"token_out\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"wbnb_address\": {\"description\": \"WBNB address (wrapped BNB)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"}, \"role\": \"token_in\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.25}, {\"address\": \"{router_address}\", \"description\": \"Correct PancakeSwap Router called\", \"type\": \"contract_called\", \"weight\": 0.15}, {\"description\": \"Correct function swapExactETHForTokens called\", \"selector\": \"0x7ff36ab5\", \"type\": \"function_selector\", \"weight\": 0.15}, {\"description\": \"BNB balance decreased by swap amount (plus gas)\", \"expected_change\": \"-{amount_in}\", \"tolerance\": \"gas_only\", \"type\": \"bnb_balance_change\", \"weight\": 0.2}, {\"description\": \"Token balance increased (received output tokens)\", \"min_increase\": 0, \"token\": \"{token_address}\", \"type\": \"token_balance_increase\", \"weight\": 0.25}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance (amount + gas)\", \"type\": \"balance_check\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"dex\": \"PancakeSwap V2\", \"difficulty_notes\": [\"Basic DEX swap operation\", \"Requires understanding of payable functions\", \"Requires understanding of swap paths\", \"Requires setting deadline parameter\"], \"estimated_gas\": 200000, \"network\": \"mainnet\", \"requires_contract\": true, \"swap_type\": \"exact_input\", \"tags\": [\"pancakeswap\", \"swap\", \"dex\", \"amm\", \"defi\", \"bnb-to-token\"]}", "source_path": "defi_operations/pancakeswap_swap/swap_exact_bnb_for_tokens.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"defi_operations\", \"description\": [\"Swap BNB for ERC20 tokens using PancakeSwap V2 Router's swapExactETHForTokens function.\", \"\", \"Technical context:\", \"- PancakeSwap V2 Router (BSC Mainnet): 0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"- Function signature: swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts)\", \"- This is a payable function that requires sending BNB with the transaction\", \"- The swap follows Uniswap V2 AMM (Automated Market Maker) model: x * y = k\", \"- Function selector: 0x7ff36ab5\", \"- Recommended gas limit: 200000\", \"\", \"Key considerations:\", \"- amountOutMin: Minimum amount of tokens to receive (slippage protection)\", \"- path: Array of token addresses for the swap route [WBNB, TOKEN]\", \"- to: Recipient address (usually the sender/agent address)\", \"- deadline: Unix timestamp after which the transaction will revert\", \"- Must set transaction 'value' field to the BNB amount being swapped\", \"- WBNB address on BSC: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\", \"\", \"Slippage protection:\", \"- Calculate amountOutMin using getAmountsOut or apply a percentage (2-5% typical)\", \"- Formula: amountOutMin = expectedOutput * (1 - slippagePercent)\", \"- For testing, can use 0 for amountOutMin (accepts any output)\", \"\", \"Success criteria:\", \"- Transaction executes successfully\", \"- Correct PancakeSwap Router is called\", \"- BNB balance decreases by amountIn (plus gas)\", \"- Token balance increases by at least amountOutMin\"], \"difficulty\": \"easy\", \"id\": \"swap_exact_bnb_for_tokens\", \"metadata\": {\"dex\": \"PancakeSwap V2\", \"difficulty_notes\": [\"Basic DEX swap operation\", \"Requires understanding of payable functions\", \"Requires understanding of swap paths\", \"Requires setting deadline parameter\"], \"estimated_gas\": 200000, \"network\": \"mainnet\", \"requires_contract\": true, \"swap_type\": \"exact_input\", \"tags\": [\"pancakeswap\", \"swap\", \"dex\", \"amm\", \"defi\", \"bnb-to-token\"]}, \"natural_language_templates\": [\"Swap {amount_in} BNB for {token_symbol} tokens on PancakeSwap\", \"Exchange {amount_in} BNB to {token_symbol} using PancakeSwap Router\", \"Convert {amount_in} BNB to {token_symbol} tokens through PancakeSwap V2\", \"Trade {amount_in} BNB for {token_symbol} on PancakeSwap with {slippage}% slippage tolerance\"], \"parameters\": {\"amount_in\": {\"description\": \"Amount of BNB to swap\", \"generation\": {\"decimals\": 4, \"max\": 0.01, \"method\": \"random\", \"min\": 0.001}, \"role\": \"swap_amount\", \"type\": \"number\", \"unit\": \"BNB\"}, \"router_address\": {\"description\": \"PancakeSwap V2 Router contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"contract\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Slippage tolerance percentage\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"slippage_tolerance\", \"type\": \"number\", \"unit\": \"percent\"}, \"token_address\": {\"description\": \"Target token to receive (USDT by default)\", \"generation\": {\"comment\": \"USDT on BSC\", \"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"token_out\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"wbnb_address\": {\"description\": \"WBNB address (wrapped BNB)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"}, \"role\": \"token_in\", \"type\": \"address\"}}, \"subcategory\": \"pancakeswap_swap\", \"title\": \"PancakeSwap Swap - BNB to Token\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.25}, {\"address\": \"{router_address}\", \"description\": \"Correct PancakeSwap Router called\", \"type\": \"contract_called\", \"weight\": 0.15}, {\"description\": \"Correct function swapExactETHForTokens called\", \"selector\": \"0x7ff36ab5\", \"type\": \"function_selector\", \"weight\": 0.15}, {\"description\": \"BNB balance decreased by swap amount (plus gas)\", \"expected_change\": \"-{amount_in}\", \"tolerance\": \"gas_only\", \"type\": \"bnb_balance_change\", \"weight\": 0.2}, {\"description\": \"Token balance increased (received output tokens)\", \"min_increase\": 0, \"token\": \"{token_address}\", \"type\": \"token_balance_increase\", \"weight\": 0.25}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient BNB balance (amount + gas)\", \"type\": \"balance_check\"}]}, \"version\": \"2.0.0\"}"} {"id": "swap_exact_tokens_for_bnb", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "pancakeswap_swap", "difficulty": "medium", "title": "PancakeSwap Swap - Token to BNB", "description": "Swap ERC20 tokens for BNB using PancakeSwap V2 Router's swapExactTokensForETH function.\n\nTechnical context:\n- PancakeSwap V2 Router (BSC Mainnet): 0x10ED43C718714eb63d5aA57B78B54704E256024E\n- Function signature: swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)\n- This function requires prior token approval to the Router contract\n- The swap follows Uniswap V2 AMM (Automated Market Maker) model: x * y = k\n- Function selector: 0x18cbafe5\n- Recommended gas limit: 180000\n\nKey considerations:\n- MUST approve tokens to Router before calling swap function\n- amountIn: Exact amount of tokens to swap\n- amountOutMin: Minimum amount of BNB to receive (slippage protection)\n- path: Array of token addresses for the swap route [TOKEN, WBNB]\n- to: Recipient address (usually the sender/agent address)\n- deadline: Unix timestamp after which the transaction will revert\n- WBNB address on BSC: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\n\nTwo-step process:\n1. Call approve(router, amountIn) on the token contract\n2. Call swapExactTokensForETH on the router contract\n\nSlippage protection:\n- Calculate amountOutMin using getAmountsOut or apply a percentage (2-5% typical)\n- Formula: amountOutMin = expectedOutput * (1 - slippagePercent)\n- For testing, can use 0 for amountOutMin (accepts any output)\n\nSuccess criteria:\n- Transaction executes successfully\n- Correct PancakeSwap Router is called\n- Token balance decreases by amountIn\n- BNB balance increases by at least amountOutMin (minus gas)", "natural_language_templates": ["Swap {amount_in} {token_symbol} for BNB on PancakeSwap", "Exchange {amount_in} {token_symbol} to BNB using PancakeSwap Router", "Convert {amount_in} {token_symbol} tokens to BNB through PancakeSwap V2", "Trade {amount_in} {token_symbol} for BNB on PancakeSwap with {slippage}% slippage tolerance"], "chain": "BSC", "network": "mainnet", "tags": ["pancakeswap", "swap", "dex", "amm", "defi", "token-to-bnb", "approval-required"], "parameter_names": ["amount_in", "router_address", "slippage", "token_address", "token_decimals", "token_symbol", "wbnb_address"], "parameters": "{\"amount_in\": {\"description\": \"Amount of tokens to swap\", \"generation\": {\"decimals\": 2, \"max\": 5.0, \"method\": \"random\", \"min\": 0.5}, \"role\": \"swap_amount\", \"type\": \"number\", \"unit\": \"token\"}, \"router_address\": {\"description\": \"PancakeSwap V2 Router contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"contract\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Slippage tolerance percentage\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"slippage_tolerance\", \"type\": \"number\", \"unit\": \"percent\"}, \"token_address\": {\"description\": \"Input token to swap (USDT by default)\", \"generation\": {\"comment\": \"USDT on BSC\", \"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"token_in\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"wbnb_address\": {\"description\": \"WBNB address (wrapped BNB)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"}, \"role\": \"token_out\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.25}, {\"address\": \"{router_address}\", \"description\": \"Token approved to Router (or approval check passed)\", \"type\": \"token_approval\", \"weight\": 0.2}, {\"address\": \"{router_address}\", \"description\": \"Correct PancakeSwap Router called\", \"type\": \"contract_called\", \"weight\": 0.1}, {\"description\": \"Correct function swapExactTokensForETH called\", \"selector\": \"0x18cbafe5\", \"type\": \"function_selector\", \"weight\": 0.1}, {\"description\": \"Token balance decreased by swap amount\", \"expected_decrease\": \"{amount_in}\", \"token\": \"{token_address}\", \"tolerance\": \"0\", \"type\": \"token_balance_decrease\", \"weight\": 0.2}, {\"description\": \"BNB balance increased (received output BNB minus gas)\", \"min_increase\": 0, \"type\": \"bnb_balance_increase\", \"weight\": 0.15}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient token balance\", \"type\": \"token_balance_check\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"dex\": \"PancakeSwap V2\", \"difficulty_notes\": [\"Requires understanding of token approval mechanism\", \"Two-step process: approve + swap\", \"Requires understanding of swap paths\", \"Must handle BNB balance change correctly (minus gas)\"], \"estimated_gas\": 180000, \"network\": \"mainnet\", \"requires_approval\": true, \"requires_contract\": true, \"swap_type\": \"exact_input\", \"tags\": [\"pancakeswap\", \"swap\", \"dex\", \"amm\", \"defi\", \"token-to-bnb\", \"approval-required\"]}", "source_path": "defi_operations/pancakeswap_swap/swap_exact_tokens_for_bnb.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"defi_operations\", \"description\": [\"Swap ERC20 tokens for BNB using PancakeSwap V2 Router's swapExactTokensForETH function.\", \"\", \"Technical context:\", \"- PancakeSwap V2 Router (BSC Mainnet): 0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"- Function signature: swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)\", \"- This function requires prior token approval to the Router contract\", \"- The swap follows Uniswap V2 AMM (Automated Market Maker) model: x * y = k\", \"- Function selector: 0x18cbafe5\", \"- Recommended gas limit: 180000\", \"\", \"Key considerations:\", \"- MUST approve tokens to Router before calling swap function\", \"- amountIn: Exact amount of tokens to swap\", \"- amountOutMin: Minimum amount of BNB to receive (slippage protection)\", \"- path: Array of token addresses for the swap route [TOKEN, WBNB]\", \"- to: Recipient address (usually the sender/agent address)\", \"- deadline: Unix timestamp after which the transaction will revert\", \"- WBNB address on BSC: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\", \"\", \"Two-step process:\", \"1. Call approve(router, amountIn) on the token contract\", \"2. Call swapExactTokensForETH on the router contract\", \"\", \"Slippage protection:\", \"- Calculate amountOutMin using getAmountsOut or apply a percentage (2-5% typical)\", \"- Formula: amountOutMin = expectedOutput * (1 - slippagePercent)\", \"- For testing, can use 0 for amountOutMin (accepts any output)\", \"\", \"Success criteria:\", \"- Transaction executes successfully\", \"- Correct PancakeSwap Router is called\", \"- Token balance decreases by amountIn\", \"- BNB balance increases by at least amountOutMin (minus gas)\"], \"difficulty\": \"medium\", \"id\": \"swap_exact_tokens_for_bnb\", \"metadata\": {\"dex\": \"PancakeSwap V2\", \"difficulty_notes\": [\"Requires understanding of token approval mechanism\", \"Two-step process: approve + swap\", \"Requires understanding of swap paths\", \"Must handle BNB balance change correctly (minus gas)\"], \"estimated_gas\": 180000, \"network\": \"mainnet\", \"requires_approval\": true, \"requires_contract\": true, \"swap_type\": \"exact_input\", \"tags\": [\"pancakeswap\", \"swap\", \"dex\", \"amm\", \"defi\", \"token-to-bnb\", \"approval-required\"]}, \"natural_language_templates\": [\"Swap {amount_in} {token_symbol} for BNB on PancakeSwap\", \"Exchange {amount_in} {token_symbol} to BNB using PancakeSwap Router\", \"Convert {amount_in} {token_symbol} tokens to BNB through PancakeSwap V2\", \"Trade {amount_in} {token_symbol} for BNB on PancakeSwap with {slippage}% slippage tolerance\"], \"parameters\": {\"amount_in\": {\"description\": \"Amount of tokens to swap\", \"generation\": {\"decimals\": 2, \"max\": 5.0, \"method\": \"random\", \"min\": 0.5}, \"role\": \"swap_amount\", \"type\": \"number\", \"unit\": \"token\"}, \"router_address\": {\"description\": \"PancakeSwap V2 Router contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"contract\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Slippage tolerance percentage\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"slippage_tolerance\", \"type\": \"number\", \"unit\": \"percent\"}, \"token_address\": {\"description\": \"Input token to swap (USDT by default)\", \"generation\": {\"comment\": \"USDT on BSC\", \"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"token_in\", \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_symbol\": {\"description\": \"Token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"wbnb_address\": {\"description\": \"WBNB address (wrapped BNB)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"}, \"role\": \"token_out\", \"type\": \"address\"}}, \"subcategory\": \"pancakeswap_swap\", \"title\": \"PancakeSwap Swap - Token to BNB\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.25}, {\"address\": \"{router_address}\", \"description\": \"Token approved to Router (or approval check passed)\", \"type\": \"token_approval\", \"weight\": 0.2}, {\"address\": \"{router_address}\", \"description\": \"Correct PancakeSwap Router called\", \"type\": \"contract_called\", \"weight\": 0.1}, {\"description\": \"Correct function swapExactTokensForETH called\", \"selector\": \"0x18cbafe5\", \"type\": \"function_selector\", \"weight\": 0.1}, {\"description\": \"Token balance decreased by swap amount\", \"expected_decrease\": \"{amount_in}\", \"token\": \"{token_address}\", \"tolerance\": \"0\", \"type\": \"token_balance_decrease\", \"weight\": 0.2}, {\"description\": \"BNB balance increased (received output BNB minus gas)\", \"min_increase\": 0, \"type\": \"bnb_balance_increase\", \"weight\": 0.15}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient token balance\", \"type\": \"token_balance_check\"}]}, \"version\": \"2.0.0\"}"} {"id": "swap_exact_tokens_for_tokens", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "pancakeswap_swap", "difficulty": "medium", "title": "PancakeSwap Swap - Token to Token", "description": "Swap one ERC20 token for another using PancakeSwap V2 Router's swapExactTokensForTokens function.\n\nTechnical context:\n- PancakeSwap V2 Router (BSC Mainnet): 0x10ED43C718714eb63d5aA57B78B54704E256024E\n- Function signature: swapExactTokensForTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)\n- This function requires prior token approval to the Router contract\n- The swap follows Uniswap V2 AMM (Automated Market Maker) model: x * y = k\n- Function selector: 0x38ed1739\n- Recommended gas limit: 200000\n\nKey considerations:\n- MUST approve input tokens to Router before calling swap function\n- amountIn: Exact amount of input tokens to swap\n- amountOutMin: Minimum amount of output tokens to receive (slippage protection)\n- path: Array of token addresses for the swap route\n- to: Recipient address (usually the sender/agent address)\n- deadline: Unix timestamp after which the transaction will revert\n\nSwap path considerations:\n- Direct path: [TOKEN_IN, TOKEN_OUT] if liquidity pool exists\n- Multi-hop path: [TOKEN_IN, WBNB, TOKEN_OUT] if direct pool doesn't exist or has low liquidity\n- WBNB address on BSC: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\n- Most token pairs route through WBNB for better liquidity\n\nTwo-step process:\n1. Call approve(router, amountIn) on the input token contract\n2. Call swapExactTokensForTokens on the router contract\n\nSlippage protection:\n- Calculate amountOutMin using getAmountsOut or apply a percentage (2-5% typical)\n- Formula: amountOutMin = expectedOutput * (1 - slippagePercent)\n- For testing, can use 0 for amountOutMin (accepts any output)\n\nSuccess criteria:\n- Transaction executes successfully\n- Correct PancakeSwap Router is called\n- Input token balance decreases by amountIn\n- Output token balance increases by at least amountOutMin", "natural_language_templates": ["Swap {amount_in} {token_in_symbol} for {token_out_symbol} on PancakeSwap", "Exchange {amount_in} {token_in_symbol} to {token_out_symbol} using PancakeSwap Router", "Convert {amount_in} {token_in_symbol} tokens to {token_out_symbol} through PancakeSwap V2", "Trade {amount_in} {token_in_symbol} for {token_out_symbol} on PancakeSwap with {slippage}% slippage tolerance"], "chain": "BSC", "network": "mainnet", "tags": ["pancakeswap", "swap", "dex", "amm", "defi", "token-to-token", "approval-required", "multi-hop"], "parameter_names": ["amount_in", "router_address", "slippage", "token_in_address", "token_in_decimals", "token_in_symbol", "token_out_address", "token_out_decimals", "token_out_symbol", "wbnb_address"], "parameters": "{\"amount_in\": {\"description\": \"Amount of input tokens to swap\", \"generation\": {\"decimals\": 2, \"max\": 5.0, \"method\": \"random\", \"min\": 0.5}, \"role\": \"swap_amount\", \"type\": \"number\", \"unit\": \"token\"}, \"router_address\": {\"description\": \"PancakeSwap V2 Router contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"contract\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Slippage tolerance percentage\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"slippage_tolerance\", \"type\": \"number\", \"unit\": \"percent\"}, \"token_in_address\": {\"description\": \"Input token to swap (USDT by default)\", \"generation\": {\"comment\": \"USDT on BSC\", \"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"token_in\", \"type\": \"address\"}, \"token_in_decimals\": {\"description\": \"Input token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_in_symbol\": {\"description\": \"Input token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"token_out_address\": {\"description\": \"Output token to receive (BUSD by default)\", \"generation\": {\"comment\": \"BUSD on BSC\", \"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"role\": \"token_out\", \"type\": \"address\"}, \"token_out_decimals\": {\"description\": \"Output token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_out_symbol\": {\"description\": \"Output token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"display\", \"type\": \"string\"}, \"wbnb_address\": {\"description\": \"WBNB address (for multi-hop routing)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"}, \"role\": \"intermediate_token\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.2}, {\"address\": \"{router_address}\", \"description\": \"Input token approved to Router (or approval check passed)\", \"type\": \"token_approval\", \"weight\": 0.15}, {\"address\": \"{router_address}\", \"description\": \"Correct PancakeSwap Router called\", \"type\": \"contract_called\", \"weight\": 0.1}, {\"description\": \"Correct function swapExactTokensForTokens called\", \"selector\": \"0x38ed1739\", \"type\": \"function_selector\", \"weight\": 0.1}, {\"description\": \"Input token balance decreased by swap amount\", \"expected_decrease\": \"{amount_in}\", \"token\": \"{token_in_address}\", \"tolerance\": \"0\", \"type\": \"token_balance_decrease\", \"weight\": 0.2}, {\"description\": \"Output token balance increased (received output tokens)\", \"min_increase\": 0, \"token\": \"{token_out_address}\", \"type\": \"token_balance_increase\", \"weight\": 0.25}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient input token balance\", \"type\": \"token_balance_check\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"dex\": \"PancakeSwap V2\", \"difficulty_notes\": [\"Requires understanding of token approval mechanism\", \"Two-step process: approve + swap\", \"Requires understanding of swap paths\", \"May need multi-hop routing through WBNB\", \"Must track two different token balances\"], \"estimated_gas\": 200000, \"network\": \"mainnet\", \"requires_approval\": true, \"requires_contract\": true, \"swap_type\": \"exact_input\", \"tags\": [\"pancakeswap\", \"swap\", \"dex\", \"amm\", \"defi\", \"token-to-token\", \"approval-required\", \"multi-hop\"]}", "source_path": "defi_operations/pancakeswap_swap/swap_exact_tokens_for_tokens.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"defi_operations\", \"description\": [\"Swap one ERC20 token for another using PancakeSwap V2 Router's swapExactTokensForTokens function.\", \"\", \"Technical context:\", \"- PancakeSwap V2 Router (BSC Mainnet): 0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"- Function signature: swapExactTokensForTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)\", \"- This function requires prior token approval to the Router contract\", \"- The swap follows Uniswap V2 AMM (Automated Market Maker) model: x * y = k\", \"- Function selector: 0x38ed1739\", \"- Recommended gas limit: 200000\", \"\", \"Key considerations:\", \"- MUST approve input tokens to Router before calling swap function\", \"- amountIn: Exact amount of input tokens to swap\", \"- amountOutMin: Minimum amount of output tokens to receive (slippage protection)\", \"- path: Array of token addresses for the swap route\", \"- to: Recipient address (usually the sender/agent address)\", \"- deadline: Unix timestamp after which the transaction will revert\", \"\", \"Swap path considerations:\", \"- Direct path: [TOKEN_IN, TOKEN_OUT] if liquidity pool exists\", \"- Multi-hop path: [TOKEN_IN, WBNB, TOKEN_OUT] if direct pool doesn't exist or has low liquidity\", \"- WBNB address on BSC: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\", \"- Most token pairs route through WBNB for better liquidity\", \"\", \"Two-step process:\", \"1. Call approve(router, amountIn) on the input token contract\", \"2. Call swapExactTokensForTokens on the router contract\", \"\", \"Slippage protection:\", \"- Calculate amountOutMin using getAmountsOut or apply a percentage (2-5% typical)\", \"- Formula: amountOutMin = expectedOutput * (1 - slippagePercent)\", \"- For testing, can use 0 for amountOutMin (accepts any output)\", \"\", \"Success criteria:\", \"- Transaction executes successfully\", \"- Correct PancakeSwap Router is called\", \"- Input token balance decreases by amountIn\", \"- Output token balance increases by at least amountOutMin\"], \"difficulty\": \"medium\", \"id\": \"swap_exact_tokens_for_tokens\", \"metadata\": {\"dex\": \"PancakeSwap V2\", \"difficulty_notes\": [\"Requires understanding of token approval mechanism\", \"Two-step process: approve + swap\", \"Requires understanding of swap paths\", \"May need multi-hop routing through WBNB\", \"Must track two different token balances\"], \"estimated_gas\": 200000, \"network\": \"mainnet\", \"requires_approval\": true, \"requires_contract\": true, \"swap_type\": \"exact_input\", \"tags\": [\"pancakeswap\", \"swap\", \"dex\", \"amm\", \"defi\", \"token-to-token\", \"approval-required\", \"multi-hop\"]}, \"natural_language_templates\": [\"Swap {amount_in} {token_in_symbol} for {token_out_symbol} on PancakeSwap\", \"Exchange {amount_in} {token_in_symbol} to {token_out_symbol} using PancakeSwap Router\", \"Convert {amount_in} {token_in_symbol} tokens to {token_out_symbol} through PancakeSwap V2\", \"Trade {amount_in} {token_in_symbol} for {token_out_symbol} on PancakeSwap with {slippage}% slippage tolerance\"], \"parameters\": {\"amount_in\": {\"description\": \"Amount of input tokens to swap\", \"generation\": {\"decimals\": 2, \"max\": 5.0, \"method\": \"random\", \"min\": 0.5}, \"role\": \"swap_amount\", \"type\": \"number\", \"unit\": \"token\"}, \"router_address\": {\"description\": \"PancakeSwap V2 Router contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"contract\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Slippage tolerance percentage\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"slippage_tolerance\", \"type\": \"number\", \"unit\": \"percent\"}, \"token_in_address\": {\"description\": \"Input token to swap (USDT by default)\", \"generation\": {\"comment\": \"USDT on BSC\", \"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"token_in\", \"type\": \"address\"}, \"token_in_decimals\": {\"description\": \"Input token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_in_symbol\": {\"description\": \"Input token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"token_out_address\": {\"description\": \"Output token to receive (BUSD by default)\", \"generation\": {\"comment\": \"BUSD on BSC\", \"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"role\": \"token_out\", \"type\": \"address\"}, \"token_out_decimals\": {\"description\": \"Output token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_out_symbol\": {\"description\": \"Output token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"display\", \"type\": \"string\"}, \"wbnb_address\": {\"description\": \"WBNB address (for multi-hop routing)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"}, \"role\": \"intermediate_token\", \"type\": \"address\"}}, \"subcategory\": \"pancakeswap_swap\", \"title\": \"PancakeSwap Swap - Token to Token\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.2}, {\"address\": \"{router_address}\", \"description\": \"Input token approved to Router (or approval check passed)\", \"type\": \"token_approval\", \"weight\": 0.15}, {\"address\": \"{router_address}\", \"description\": \"Correct PancakeSwap Router called\", \"type\": \"contract_called\", \"weight\": 0.1}, {\"description\": \"Correct function swapExactTokensForTokens called\", \"selector\": \"0x38ed1739\", \"type\": \"function_selector\", \"weight\": 0.1}, {\"description\": \"Input token balance decreased by swap amount\", \"expected_decrease\": \"{amount_in}\", \"token\": \"{token_in_address}\", \"tolerance\": \"0\", \"type\": \"token_balance_decrease\", \"weight\": 0.2}, {\"description\": \"Output token balance increased (received output tokens)\", \"min_increase\": 0, \"token\": \"{token_out_address}\", \"type\": \"token_balance_increase\", \"weight\": 0.25}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient input token balance\", \"type\": \"token_balance_check\"}]}, \"version\": \"2.0.0\"}"} {"id": "swap_multihop_routing", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "pancakeswap_swap", "difficulty": "hard", "title": "PancakeSwap Multi-hop Routing Swap", "description": "Execute a multi-hop token swap on PancakeSwap Router V2. This operation involves swapping tokens through multiple intermediate tokens to achieve better liquidity and pricing. The swap path must be: CAKE → WBNB → USDT → BUSD (4 tokens). You must use the exact input amount specified in the task. Call getAmountsOut() first to estimate output amounts, then calculate amountOutMin with slippage tolerance. Use swapExactTokensForTokens function with the complete 4-token path.", "natural_language_templates": ["Swap {amount_in} {token_start_symbol} for {token_end_symbol} on PancakeSwap using a multi-hop routing path through WBNB and USDT", "Execute a multi-hop token swap: exchange {amount_in} {token_start_symbol} to {token_end_symbol} via intermediate tokens for better liquidity", "Perform a complex token swap on PancakeSwap: {amount_in} {token_start_symbol} → WBNB → USDT → {token_end_symbol}", "Use PancakeSwap Router to swap {amount_in} {token_start_symbol} for {token_end_symbol} with optimal multi-hop routing"], "chain": "", "network": "bsc", "tags": ["defi", "dex", "swap", "pancakeswap", "multihop", "routing", "optimization"], "parameter_names": ["amount_in", "router_address", "slippage", "token_end_address", "token_end_decimals", "token_end_symbol", "token_start_address", "token_start_decimals", "token_start_symbol", "usdt_address", "wbnb_address"], "parameters": "{\"amount_in\": {\"description\": \"Amount of starting tokens to swap (in human-readable format, e.g., 1.5)\", \"generation\": {\"method\": \"fixed\", \"value\": 2.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router V2 contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Maximum acceptable slippage percentage (e.g., 5.0 for 5%)\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_end_address\": {\"description\": \"Ending token address (last token in the path)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_end_decimals\": {\"description\": \"Ending token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_end_symbol\": {\"description\": \"Ending token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_start_address\": {\"description\": \"Starting token address (first token in the path)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_start_decimals\": {\"description\": \"Starting token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_start_symbol\": {\"description\": \"Starting token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"CAKE\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"usdt_address\": {\"description\": \"USDT address (intermediate token)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"address\", \"type\": \"address\"}, \"wbnb_address\": {\"description\": \"Wrapped BNB address (intermediate token)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"}, \"role\": \"address\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [], \"pre_conditions\": [], \"rules\": [{\"description\": \"Transaction must be successfully executed and confirmed\", \"type\": \"transaction_success\"}, {\"description\": \"Starting token must have been approved for Router (or have existing allowance)\", \"spender\": \"{{router_address}}\", \"token\": \"{{token_start_address}}\", \"type\": \"token_approval\"}, {\"contract\": \"{{router_address}}\", \"description\": \"Must interact with PancakeSwap Router contract\", \"type\": \"contract_interaction\"}, {\"description\": \"Must call swapExactTokensForTokens function\", \"function_selector\": \"0x38ed1739\", \"type\": \"function_call\"}, {\"amount\": \"{{amount_in}}\", \"change\": \"decrease\", \"description\": \"Starting token balance must decrease by the specified amount\", \"token\": \"{{token_start_address}}\", \"type\": \"balance_change\"}, {\"change\": \"increase\", \"description\": \"Ending token balance must increase (accounting for slippage)\", \"minimum_increase\": \"calculated_based_on_slippage\", \"token\": \"{{token_end_address}}\", \"type\": \"balance_change\"}, {\"description\": \"Must use the complete multi-hop path (3+ hops)\", \"minimum_hops\": 3, \"path\": [\"{{token_start_address}}\", \"{{wbnb_address}}\", \"{{usdt_address}}\", \"{{token_end_address}}\"], \"type\": \"multi_hop_path\"}], \"scoring\": {\"correct_function\": 10, \"correct_multihop_path\": 10, \"correct_router\": 10, \"input_token_decrease\": 20, \"output_token_increase\": 20, \"token_approval\": 10, \"transaction_success\": 20}}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"common_pitfalls\": [\"Using inefficient routing paths\", \"Not accounting for cumulative slippage\", \"Insufficient allowance for input token\", \"Not checking liquidity at each hop\", \"Incorrect path order or missing intermediate tokens\"], \"complexity\": \"high\", \"estimated_gas\": \"250000-300000\", \"learning_objectives\": [\"Understanding multi-hop routing in DEXes\", \"Optimizing swap paths for better liquidity\", \"Managing complex token swap paths\", \"Calculating aggregate slippage across multiple hops\", \"Understanding liquidity pools and pair relationships\"], \"requires_contract\": false, \"requires_native_token\": false, \"tags\": [\"defi\", \"dex\", \"swap\", \"pancakeswap\", \"multihop\", \"routing\", \"optimization\"]}", "source_path": "defi_operations/pancakeswap_swap/swap_multihop_routing.json", "raw_definition": "{\"blockchain\": {\"contract_address\": \"{{router_address}}\", \"function_name\": \"swapExactTokensForTokens\", \"function_signature\": \"swapExactTokensForTokens(uint256,uint256,address[],address,uint256)\", \"network\": \"bsc\"}, \"category\": \"defi_operations\", \"description\": \"Execute a multi-hop token swap on PancakeSwap Router V2. This operation involves swapping tokens through multiple intermediate tokens to achieve better liquidity and pricing. The swap path must be: CAKE → WBNB → USDT → BUSD (4 tokens). You must use the exact input amount specified in the task. Call getAmountsOut() first to estimate output amounts, then calculate amountOutMin with slippage tolerance. Use swapExactTokensForTokens function with the complete 4-token path.\", \"difficulty\": \"hard\", \"id\": \"swap_multihop_routing\", \"metadata\": {\"common_pitfalls\": [\"Using inefficient routing paths\", \"Not accounting for cumulative slippage\", \"Insufficient allowance for input token\", \"Not checking liquidity at each hop\", \"Incorrect path order or missing intermediate tokens\"], \"complexity\": \"high\", \"estimated_gas\": \"250000-300000\", \"learning_objectives\": [\"Understanding multi-hop routing in DEXes\", \"Optimizing swap paths for better liquidity\", \"Managing complex token swap paths\", \"Calculating aggregate slippage across multiple hops\", \"Understanding liquidity pools and pair relationships\"], \"requires_contract\": false, \"requires_native_token\": false, \"tags\": [\"defi\", \"dex\", \"swap\", \"pancakeswap\", \"multihop\", \"routing\", \"optimization\"]}, \"natural_language_templates\": [\"Swap {amount_in} {token_start_symbol} for {token_end_symbol} on PancakeSwap using a multi-hop routing path through WBNB and USDT\", \"Execute a multi-hop token swap: exchange {amount_in} {token_start_symbol} to {token_end_symbol} via intermediate tokens for better liquidity\", \"Perform a complex token swap on PancakeSwap: {amount_in} {token_start_symbol} → WBNB → USDT → {token_end_symbol}\", \"Use PancakeSwap Router to swap {amount_in} {token_start_symbol} for {token_end_symbol} with optimal multi-hop routing\"], \"parameters\": {\"amount_in\": {\"description\": \"Amount of starting tokens to swap (in human-readable format, e.g., 1.5)\", \"generation\": {\"method\": \"fixed\", \"value\": 2.0}, \"role\": \"transfer_amount\", \"type\": \"number\"}, \"router_address\": {\"description\": \"PancakeSwap Router V2 contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"address\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Maximum acceptable slippage percentage (e.g., 5.0 for 5%)\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"parameter\", \"type\": \"number\"}, \"token_end_address\": {\"description\": \"Ending token address (last token in the path)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_end_decimals\": {\"description\": \"Ending token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_end_symbol\": {\"description\": \"Ending token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"token_start_address\": {\"description\": \"Starting token address (first token in the path)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"token_start_decimals\": {\"description\": \"Starting token decimals\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"parameter\", \"type\": \"integer\"}, \"token_start_symbol\": {\"description\": \"Starting token symbol\", \"generation\": {\"method\": \"fixed\", \"value\": \"CAKE\"}, \"role\": \"parameter\", \"type\": \"string\"}, \"usdt_address\": {\"description\": \"USDT address (intermediate token)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"address\", \"type\": \"address\"}, \"wbnb_address\": {\"description\": \"Wrapped BNB address (intermediate token)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"}, \"role\": \"address\", \"type\": \"address\"}}, \"preconditions\": {\"account_balance\": {\"description\": \"Test account must have sufficient starting token balance\", \"minimum_balance\": \"{{amount_in}}\", \"token\": \"{{token_start_address}}\"}, \"liquidity\": {\"description\": \"Sufficient liquidity must exist for each pair in the multi-hop path\", \"pairs\": [\"{{token_start_address}}/{{wbnb_address}}\", \"{{wbnb_address}}/{{usdt_address}}\", \"{{usdt_address}}/{{token_end_address}}\"]}, \"token_approval\": {\"description\": \"Starting token must be approved for PancakeSwap Router\", \"minimum_allowance\": \"{{amount_in}}\", \"spender\": \"{{router_address}}\", \"token\": \"{{token_start_address}}\"}}, \"subcategory\": \"pancakeswap_swap\", \"title\": \"PancakeSwap Multi-hop Routing Swap\", \"validation\": {\"post_conditions\": [], \"pre_conditions\": [], \"rules\": [{\"description\": \"Transaction must be successfully executed and confirmed\", \"type\": \"transaction_success\"}, {\"description\": \"Starting token must have been approved for Router (or have existing allowance)\", \"spender\": \"{{router_address}}\", \"token\": \"{{token_start_address}}\", \"type\": \"token_approval\"}, {\"contract\": \"{{router_address}}\", \"description\": \"Must interact with PancakeSwap Router contract\", \"type\": \"contract_interaction\"}, {\"description\": \"Must call swapExactTokensForTokens function\", \"function_selector\": \"0x38ed1739\", \"type\": \"function_call\"}, {\"amount\": \"{{amount_in}}\", \"change\": \"decrease\", \"description\": \"Starting token balance must decrease by the specified amount\", \"token\": \"{{token_start_address}}\", \"type\": \"balance_change\"}, {\"change\": \"increase\", \"description\": \"Ending token balance must increase (accounting for slippage)\", \"minimum_increase\": \"calculated_based_on_slippage\", \"token\": \"{{token_end_address}}\", \"type\": \"balance_change\"}, {\"description\": \"Must use the complete multi-hop path (3+ hops)\", \"minimum_hops\": 3, \"path\": [\"{{token_start_address}}\", \"{{wbnb_address}}\", \"{{usdt_address}}\", \"{{token_end_address}}\"], \"type\": \"multi_hop_path\"}], \"scoring\": {\"correct_function\": 10, \"correct_multihop_path\": 10, \"correct_router\": 10, \"input_token_decrease\": 20, \"output_token_increase\": 20, \"token_approval\": 10, \"transaction_success\": 20}}, \"version\": \"2.0.0\"}"} {"id": "swap_tokens_for_exact_tokens", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "pancakeswap_swap", "difficulty": "hard", "title": "PancakeSwap Swap - Exact Output (Token to Token)", "description": "Swap tokens to receive an exact amount of output tokens using PancakeSwap V2 Router's swapTokensForExactTokens function.\n\nTechnical context:\n- PancakeSwap V2 Router (BSC Mainnet): 0x10ED43C718714eb63d5aA57B78B54704E256024E\n- Function signature: swapTokensForExactTokens(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)\n- This is an EXACT OUTPUT swap (opposite of exact input)\n- The swap follows Uniswap V2 AMM (Automated Market Maker) model: x * y = k\n- Function selector: 0x8803dbee\n- Recommended gas limit: 200000\n\nKey considerations:\n- amountOut: EXACT amount of output tokens desired (user specifies this)\n- amountInMax: MAXIMUM amount of input tokens willing to spend (slippage protection)\n- path: Array of token addresses for the swap route\n- to: Recipient address (usually the sender/agent address)\n- deadline: Unix timestamp after which the transaction will revert\n- MUST approve sufficient tokens (at least amountInMax) to Router\n\nExact output vs exact input:\n- Exact input: You know how much you're selling, output is variable\n- Exact output: You know how much you want to buy, input is variable (up to amountInMax)\n- This function is useful when you need a precise amount of output tokens\n- Example: Buying exactly 100 USDT to pay for something\n\nTwo-step process:\n1. Call getAmountsIn(amountOut, path) to estimate required input\n2. Calculate amountInMax with slippage tolerance\n3. Approve amountInMax (or more) to Router\n4. Call swapTokensForExactTokens on the router contract\n\nSlippage protection:\n- Calculate amountInMax using getAmountsIn and apply slippage\n- Formula: amountInMax = expectedInput * (1 + slippagePercent)\n- The actual input used will be <= amountInMax\n- For testing, can set high amountInMax to accept any input cost\n\nSuccess criteria:\n- Transaction executes successfully\n- Correct PancakeSwap Router is called\n- Output token balance increases by EXACTLY amountOut\n- Input token balance decreases by <= amountInMax", "natural_language_templates": ["Swap tokens to get exactly {amount_out} {token_out_symbol} on PancakeSwap", "Exchange tokens for precisely {amount_out} {token_out_symbol} using PancakeSwap Router", "Buy exactly {amount_out} {token_out_symbol} with {token_in_symbol} through PancakeSwap V2", "Trade {token_in_symbol} for exactly {amount_out} {token_out_symbol} on PancakeSwap with {slippage}% max slippage"], "chain": "BSC", "network": "mainnet", "tags": ["pancakeswap", "swap", "dex", "amm", "defi", "token-to-token", "exact-output", "approval-required", "multi-hop", "advanced"], "parameter_names": ["amount_out", "router_address", "slippage", "token_in_address", "token_in_decimals", "token_in_symbol", "token_out_address", "token_out_decimals", "token_out_symbol", "wbnb_address"], "parameters": "{\"amount_out\": {\"description\": \"Exact amount of output tokens to receive\", \"generation\": {\"decimals\": 2, \"max\": 3.0, \"method\": \"random\", \"min\": 0.5}, \"role\": \"exact_output_amount\", \"type\": \"number\", \"unit\": \"token\"}, \"router_address\": {\"description\": \"PancakeSwap V2 Router contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"contract\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Slippage tolerance percentage (for amountInMax calculation)\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"slippage_tolerance\", \"type\": \"number\", \"unit\": \"percent\"}, \"token_in_address\": {\"description\": \"Input token to spend (USDT by default)\", \"generation\": {\"comment\": \"USDT on BSC\", \"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"token_in\", \"type\": \"address\"}, \"token_in_decimals\": {\"description\": \"Input token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_in_symbol\": {\"description\": \"Input token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"token_out_address\": {\"description\": \"Output token to receive (BUSD by default)\", \"generation\": {\"comment\": \"BUSD on BSC\", \"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"role\": \"token_out\", \"type\": \"address\"}, \"token_out_decimals\": {\"description\": \"Output token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_out_symbol\": {\"description\": \"Output token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"display\", \"type\": \"string\"}, \"wbnb_address\": {\"description\": \"WBNB address (for multi-hop routing)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"}, \"role\": \"intermediate_token\", \"type\": \"address\"}}", "validation": "{\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.2}, {\"address\": \"{router_address}\", \"description\": \"Input token approved to Router with sufficient amount\", \"type\": \"token_approval\", \"weight\": 0.15}, {\"address\": \"{router_address}\", \"description\": \"Correct PancakeSwap Router called\", \"type\": \"contract_called\", \"weight\": 0.1}, {\"description\": \"Correct function swapTokensForExactTokens called\", \"selector\": \"0x8803dbee\", \"type\": \"function_selector\", \"weight\": 0.15}, {\"description\": \"Output token balance increased by EXACTLY amountOut\", \"expected_increase\": \"{amount_out}\", \"token\": \"{token_out_address}\", \"tolerance\": \"0.001\", \"type\": \"token_balance_exact_increase\", \"weight\": 0.25}, {\"description\": \"Input token balance decreased within acceptable range\", \"max_decrease\": \"calculated_from_slippage\", \"token\": \"{token_in_address}\", \"type\": \"token_balance_decrease_within_max\", \"weight\": 0.15}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient input token balance to cover amountInMax\", \"type\": \"token_balance_check\"}]}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"dex\": \"PancakeSwap V2\", \"difficulty_notes\": [\"Requires understanding of exact output swaps (opposite of exact input)\", \"Must calculate amountInMax correctly using getAmountsIn\", \"Approval must cover the maximum possible input (amountInMax)\", \"More complex slippage calculation (input side, not output side)\", \"Must validate exact output amount received\", \"Input amount validation requires range check (not exact match)\"], \"estimated_gas\": 200000, \"network\": \"mainnet\", \"requires_approval\": true, \"requires_contract\": true, \"swap_type\": \"exact_output\", \"tags\": [\"pancakeswap\", \"swap\", \"dex\", \"amm\", \"defi\", \"token-to-token\", \"exact-output\", \"approval-required\", \"multi-hop\", \"advanced\"]}", "source_path": "defi_operations/pancakeswap_swap/swap_tokens_for_exact_tokens.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"defi_operations\", \"description\": [\"Swap tokens to receive an exact amount of output tokens using PancakeSwap V2 Router's swapTokensForExactTokens function.\", \"\", \"Technical context:\", \"- PancakeSwap V2 Router (BSC Mainnet): 0x10ED43C718714eb63d5aA57B78B54704E256024E\", \"- Function signature: swapTokensForExactTokens(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)\", \"- This is an EXACT OUTPUT swap (opposite of exact input)\", \"- The swap follows Uniswap V2 AMM (Automated Market Maker) model: x * y = k\", \"- Function selector: 0x8803dbee\", \"- Recommended gas limit: 200000\", \"\", \"Key considerations:\", \"- amountOut: EXACT amount of output tokens desired (user specifies this)\", \"- amountInMax: MAXIMUM amount of input tokens willing to spend (slippage protection)\", \"- path: Array of token addresses for the swap route\", \"- to: Recipient address (usually the sender/agent address)\", \"- deadline: Unix timestamp after which the transaction will revert\", \"- MUST approve sufficient tokens (at least amountInMax) to Router\", \"\", \"Exact output vs exact input:\", \"- Exact input: You know how much you're selling, output is variable\", \"- Exact output: You know how much you want to buy, input is variable (up to amountInMax)\", \"- This function is useful when you need a precise amount of output tokens\", \"- Example: Buying exactly 100 USDT to pay for something\", \"\", \"Two-step process:\", \"1. Call getAmountsIn(amountOut, path) to estimate required input\", \"2. Calculate amountInMax with slippage tolerance\", \"3. Approve amountInMax (or more) to Router\", \"4. Call swapTokensForExactTokens on the router contract\", \"\", \"Slippage protection:\", \"- Calculate amountInMax using getAmountsIn and apply slippage\", \"- Formula: amountInMax = expectedInput * (1 + slippagePercent)\", \"- The actual input used will be <= amountInMax\", \"- For testing, can set high amountInMax to accept any input cost\", \"\", \"Success criteria:\", \"- Transaction executes successfully\", \"- Correct PancakeSwap Router is called\", \"- Output token balance increases by EXACTLY amountOut\", \"- Input token balance decreases by <= amountInMax\"], \"difficulty\": \"hard\", \"id\": \"swap_tokens_for_exact_tokens\", \"metadata\": {\"dex\": \"PancakeSwap V2\", \"difficulty_notes\": [\"Requires understanding of exact output swaps (opposite of exact input)\", \"Must calculate amountInMax correctly using getAmountsIn\", \"Approval must cover the maximum possible input (amountInMax)\", \"More complex slippage calculation (input side, not output side)\", \"Must validate exact output amount received\", \"Input amount validation requires range check (not exact match)\"], \"estimated_gas\": 200000, \"network\": \"mainnet\", \"requires_approval\": true, \"requires_contract\": true, \"swap_type\": \"exact_output\", \"tags\": [\"pancakeswap\", \"swap\", \"dex\", \"amm\", \"defi\", \"token-to-token\", \"exact-output\", \"approval-required\", \"multi-hop\", \"advanced\"]}, \"natural_language_templates\": [\"Swap tokens to get exactly {amount_out} {token_out_symbol} on PancakeSwap\", \"Exchange tokens for precisely {amount_out} {token_out_symbol} using PancakeSwap Router\", \"Buy exactly {amount_out} {token_out_symbol} with {token_in_symbol} through PancakeSwap V2\", \"Trade {token_in_symbol} for exactly {amount_out} {token_out_symbol} on PancakeSwap with {slippage}% max slippage\"], \"parameters\": {\"amount_out\": {\"description\": \"Exact amount of output tokens to receive\", \"generation\": {\"decimals\": 2, \"max\": 3.0, \"method\": \"random\", \"min\": 0.5}, \"role\": \"exact_output_amount\", \"type\": \"number\", \"unit\": \"token\"}, \"router_address\": {\"description\": \"PancakeSwap V2 Router contract address\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\"}, \"role\": \"contract\", \"type\": \"address\"}, \"slippage\": {\"description\": \"Slippage tolerance percentage (for amountInMax calculation)\", \"generation\": {\"method\": \"fixed\", \"value\": 5.0}, \"role\": \"slippage_tolerance\", \"type\": \"number\", \"unit\": \"percent\"}, \"token_in_address\": {\"description\": \"Input token to spend (USDT by default)\", \"generation\": {\"comment\": \"USDT on BSC\", \"method\": \"fixed\", \"value\": \"0x55d398326f99059fF775485246999027B3197955\"}, \"role\": \"token_in\", \"type\": \"address\"}, \"token_in_decimals\": {\"description\": \"Input token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_in_symbol\": {\"description\": \"Input token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"USDT\"}, \"role\": \"display\", \"type\": \"string\"}, \"token_out_address\": {\"description\": \"Output token to receive (BUSD by default)\", \"generation\": {\"comment\": \"BUSD on BSC\", \"method\": \"fixed\", \"value\": \"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56\"}, \"role\": \"token_out\", \"type\": \"address\"}, \"token_out_decimals\": {\"description\": \"Output token decimal places\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"role\": \"calculation\", \"type\": \"integer\"}, \"token_out_symbol\": {\"description\": \"Output token symbol for display\", \"generation\": {\"method\": \"fixed\", \"value\": \"BUSD\"}, \"role\": \"display\", \"type\": \"string\"}, \"wbnb_address\": {\"description\": \"WBNB address (for multi-hop routing)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\"}, \"role\": \"intermediate_token\", \"type\": \"address\"}}, \"subcategory\": \"pancakeswap_swap\", \"title\": \"PancakeSwap Swap - Exact Output (Token to Token)\", \"validation\": {\"post_conditions\": [{\"description\": \"Transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.2}, {\"address\": \"{router_address}\", \"description\": \"Input token approved to Router with sufficient amount\", \"type\": \"token_approval\", \"weight\": 0.15}, {\"address\": \"{router_address}\", \"description\": \"Correct PancakeSwap Router called\", \"type\": \"contract_called\", \"weight\": 0.1}, {\"description\": \"Correct function swapTokensForExactTokens called\", \"selector\": \"0x8803dbee\", \"type\": \"function_selector\", \"weight\": 0.15}, {\"description\": \"Output token balance increased by EXACTLY amountOut\", \"expected_increase\": \"{amount_out}\", \"token\": \"{token_out_address}\", \"tolerance\": \"0.001\", \"type\": \"token_balance_exact_increase\", \"weight\": 0.25}, {\"description\": \"Input token balance decreased within acceptable range\", \"max_decrease\": \"calculated_from_slippage\", \"token\": \"{token_in_address}\", \"type\": \"token_balance_decrease_within_max\", \"weight\": 0.15}], \"pre_conditions\": [{\"description\": \"Agent must have sufficient input token balance to cover amountInMax\", \"type\": \"token_balance_check\"}]}, \"version\": \"2.0.0\"}"} {"id": "emergency_withdraw", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "staking_farming", "difficulty": "easy", "title": "Emergency Withdraw from Staking Pool", "description": "Emergency withdraw all staked LP tokens from a farming pool, forfeiting all accumulated rewards. This is an emergency function to quickly retrieve staked assets without claiming rewards.\n\nIMPORTANT: This is a SimpleRewardPool contract with emergencyWithdraw() function.\n- Contract function: emergencyWithdraw() - NO PARAMETERS\n- This function withdraws ALL staked LP tokens\n- All pending rewards are FORFEITED (not claimed)\n- User's staking record is completely cleared\n- This is faster and uses less gas than normal withdraw\n\nRequired steps:\n1. Query current staked amount: rewardPool.userInfo(user_address)\n2. Query current LP token balance: lpToken.balanceOf(user_address)\n3. Call emergencyWithdraw: rewardPool.emergencyWithdraw()\n4. Verify ALL LP tokens are returned\n5. Verify staked amount becomes 0\n6. Verify rewards are NOT claimed (CAKE balance should not increase)\n\nContract details:\n- SimpleRewardPool contract address: pool_address (dynamic parameter)\n- Staking token: USDT/BUSD LP (0x7EFaEf62fDdCCa950418312c6C91Aef321375A00)\n- Emergency withdraw function signature: emergencyWithdraw()\n- NO amount parameter - withdraws everything\n- Rewards are forfeited - this is the trade-off for emergency speed\n\nTo get the pool address from deployed contracts:\nconst poolAddress = deployedContracts['simple_reward_pool']\n\nFunction call construction:\n```typescript\nconst SimpleRewardPoolABI = [\n 'function emergencyWithdraw() external'\n];\nconst contract = new Contract interface(poolAddress, SimpleRewardPoolABI, provider);\nconst data = encode the function call('emergencyWithdraw', []);\n```\n\nCommon mistakes to avoid:\n- DO NOT pass any parameters to emergencyWithdraw()\n- DO understand that rewards will be lost\n- DO verify that CAKE balance does NOT increase (rewards forfeited)\n- This is meant for emergency situations only", "natural_language_templates": ["Emergency withdraw all staked LP tokens from the pool at {pool_address}", "Quickly retrieve all LP tokens from staking pool {pool_address} (forfeit rewards)", "Execute emergency withdrawal from farming pool {pool_address}", "Unstake all USDT/BUSD LP tokens immediately, forfeiting CAKE rewards"], "chain": "BSC", "network": "mainnet", "tags": ["emergency", "withdraw", "unstake", "farming", "defi"], "parameter_names": ["chain_id", "lp_token_address", "pool_address", "reward_token_address", "user_address"], "parameters": "{\"chain_id\": {\"description\": \"Blockchain network ID (56 for BSC Mainnet)\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"lp_token_address\": {\"description\": \"LP token address (USDT/BUSD pair)\", \"example\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"pool_address\": {\"description\": \"SimpleRewardPool contract address\", \"dynamic\": true, \"generation\": {\"env_key\": \"simple_reward_pool_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"reward_token_address\": {\"description\": \"Reward token address (CAKE)\", \"example\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"user_address\": {\"description\": \"User's wallet address\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}}", "validation": "{}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{}", "source_path": "defi_operations/staking_farming/emergency_withdraw.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"defi_operations\", \"contracts\": {\"cake_token\": {\"abi_functions\": [\"function balanceOf(address account) external view returns (uint256)\"], \"address\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\", \"name\": \"PancakeSwap Token (CAKE)\"}, \"lp_token\": {\"abi_functions\": [\"function balanceOf(address account) external view returns (uint256)\"], \"address\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\", \"name\": \"PancakeSwap LP Token (USDT/BUSD)\"}, \"simple_reward_pool\": {\"abi_functions\": [\"function emergencyWithdraw() external\", \"function userInfo(address _user) external view returns (uint256 amount, uint256 rewardDebt)\"], \"address\": \"dynamic\", \"name\": \"SimpleRewardPool\"}}, \"description\": [\"Emergency withdraw all staked LP tokens from a farming pool, forfeiting all accumulated rewards. This is an emergency function to quickly retrieve staked assets without claiming rewards.\", \"\", \"IMPORTANT: This is a SimpleRewardPool contract with emergencyWithdraw() function.\", \"- Contract function: emergencyWithdraw() - NO PARAMETERS\", \"- This function withdraws ALL staked LP tokens\", \"- All pending rewards are FORFEITED (not claimed)\", \"- User's staking record is completely cleared\", \"- This is faster and uses less gas than normal withdraw\", \"\", \"Required steps:\", \"1. Query current staked amount: rewardPool.userInfo(user_address)\", \"2. Query current LP token balance: lpToken.balanceOf(user_address)\", \"3. Call emergencyWithdraw: rewardPool.emergencyWithdraw()\", \"4. Verify ALL LP tokens are returned\", \"5. Verify staked amount becomes 0\", \"6. Verify rewards are NOT claimed (CAKE balance should not increase)\", \"\", \"Contract details:\", \"- SimpleRewardPool contract address: pool_address (dynamic parameter)\", \"- Staking token: USDT/BUSD LP (0x7EFaEf62fDdCCa950418312c6C91Aef321375A00)\", \"- Emergency withdraw function signature: emergencyWithdraw()\", \"- NO amount parameter - withdraws everything\", \"- Rewards are forfeited - this is the trade-off for emergency speed\", \"\", \"To get the pool address from deployed contracts:\", \"const poolAddress = deployedContracts['simple_reward_pool']\", \"\", \"Function call construction:\", \"```typescript\", \"const SimpleRewardPoolABI = [\", \" 'function emergencyWithdraw() external'\", \"];\", \"const contract = new Contract interface(poolAddress, SimpleRewardPoolABI, provider);\", \"const data = encode the function call('emergencyWithdraw', []);\", \"```\", \"\", \"Common mistakes to avoid:\", \"- DO NOT pass any parameters to emergencyWithdraw()\", \"- DO understand that rewards will be lost\", \"- DO verify that CAKE balance does NOT increase (rewards forfeited)\", \"- This is meant for emergency situations only\"], \"difficulty\": \"easy\", \"expected_behavior\": {\"gas_estimate\": 100000, \"state_changes\": [\"User's LP token balance increases by entire staked amount\", \"User's staked amount in pool becomes 0\", \"User's CAKE balance does NOT increase (rewards forfeited)\"], \"transaction_count\": 1}, \"hints\": [\"Call emergencyWithdraw() with NO parameters\", \"This withdraws ALL staked tokens at once\", \"Rewards are forfeited - CAKE balance should not increase\", \"Verify userInfo shows 0 staked amount after transaction\", \"This is faster than normal withdraw but you lose rewards\"], \"id\": \"emergency_withdraw\", \"natural_language_templates\": [\"Emergency withdraw all staked LP tokens from the pool at {pool_address}\", \"Quickly retrieve all LP tokens from staking pool {pool_address} (forfeit rewards)\", \"Execute emergency withdrawal from farming pool {pool_address}\", \"Unstake all USDT/BUSD LP tokens immediately, forfeiting CAKE rewards\"], \"parameters\": {\"chain_id\": {\"description\": \"Blockchain network ID (56 for BSC Mainnet)\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"lp_token_address\": {\"description\": \"LP token address (USDT/BUSD pair)\", \"example\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"pool_address\": {\"description\": \"SimpleRewardPool contract address\", \"dynamic\": true, \"generation\": {\"env_key\": \"simple_reward_pool_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"reward_token_address\": {\"description\": \"Reward token address (CAKE)\", \"example\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"user_address\": {\"description\": \"User's wallet address\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}}, \"subcategory\": \"staking_farming\", \"tags\": [\"emergency\", \"withdraw\", \"unstake\", \"farming\", \"defi\"], \"test_script_template\": \"emergency_withdraw.ts\", \"title\": \"Emergency Withdraw from Staking Pool\", \"validation_criteria\": {\"lp_token_full_return\": {\"description\": \"All staked LP tokens returned to user\", \"weight\": 40}, \"rewards_not_claimed\": {\"description\": \"Rewards NOT claimed (CAKE balance unchanged)\", \"weight\": 10}, \"staking_record_cleared\": {\"description\": \"User's staking record cleared (amount = 0)\", \"weight\": 20}, \"transaction_success\": {\"description\": \"Transaction executed successfully without reverting\", \"weight\": 30}}, \"version\": \"2.0.0\"}"} {"id": "harvest_rewards", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "staking_farming", "difficulty": "medium", "title": "Harvest Farming Rewards", "description": "Harvest (claim) accumulated farming rewards from a staking pool. This operation collects the rewards earned from staking without unstaking the principal.\n\nIMPORTANT: This is a SimpleRewardPool contract with a harvest() function.\n- Contract function: harvest() - NO PARAMETERS\n- This function claims all pending rewards for the caller\n- The pool_address parameter is the SimpleRewardPool contract address\n- Rewards are paid in CAKE tokens\n\nRequired steps:\n1. Query pending rewards: rewardPool.pendingReward(user_address)\n2. Check current CAKE balance: cakeToken.balanceOf(user_address)\n3. Call harvest to claim rewards: rewardPool.harvest()\n4. Verify CAKE balance increased\n\nContract details:\n- SimpleRewardPool contract address: pool_address (dynamic parameter)\n- Reward token: CAKE (0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82)\n- Harvest function signature: harvest() - no parameters\n\nTo get the pool address from deployed contracts:\nconst poolAddress = deployedContracts['simple_reward_pool']\n\nFunction call construction:\n```typescript\nconst SimpleRewardPoolABI = [\n 'function harvest() external'\n];\nconst contract = new Contract interface(poolAddress, SimpleRewardPoolABI, provider);\nconst data = encode the function call('harvest', []);\n```\n\nCommon mistakes to avoid:\n- DO NOT pass any parameters to harvest() - it's a parameterless function\n- DO ensure you have pending rewards before harvesting\n- DO check the reward token (CAKE) balance before and after", "natural_language_templates": ["Harvest farming rewards from the pool at {pool_address}", "Claim accumulated rewards from the farming pool", "Collect farming rewards without unstaking", "Harvest CAKE rewards from the staking pool"], "chain": "BSC", "network": "mainnet", "tags": ["harvest", "farming", "rewards", "defi", "yield"], "parameter_names": ["chain_id", "pool_address", "reward_token_address", "user_address"], "parameters": "{\"chain_id\": {\"description\": \"Blockchain network ID (56 for BSC Mainnet)\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"pool_address\": {\"description\": \"SimpleRewardPool contract address\", \"dynamic\": true, \"generation\": {\"env_key\": \"simple_reward_pool_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"reward_token_address\": {\"description\": \"Reward token address (CAKE)\", \"example\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"user_address\": {\"description\": \"User's wallet address\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}}", "validation": "{}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{}", "source_path": "defi_operations/staking_farming/harvest_rewards.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"defi_operations\", \"contracts\": {\"cake_token\": {\"abi_functions\": [\"function balanceOf(address account) external view returns (uint256)\", \"function transfer(address to, uint256 amount) external returns (bool)\"], \"address\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\", \"name\": \"PancakeSwap Token (CAKE)\"}, \"simple_reward_pool\": {\"abi_functions\": [\"function harvest() external\", \"function pendingReward(address _user) external view returns (uint256)\", \"function userInfo(address _user) external view returns (uint256 amount, uint256 rewardDebt)\"], \"address\": \"dynamic\", \"name\": \"SimpleRewardPool\"}}, \"description\": [\"Harvest (claim) accumulated farming rewards from a staking pool. This operation collects the rewards earned from staking without unstaking the principal.\", \"\", \"IMPORTANT: This is a SimpleRewardPool contract with a harvest() function.\", \"- Contract function: harvest() - NO PARAMETERS\", \"- This function claims all pending rewards for the caller\", \"- The pool_address parameter is the SimpleRewardPool contract address\", \"- Rewards are paid in CAKE tokens\", \"\", \"Required steps:\", \"1. Query pending rewards: rewardPool.pendingReward(user_address)\", \"2. Check current CAKE balance: cakeToken.balanceOf(user_address)\", \"3. Call harvest to claim rewards: rewardPool.harvest()\", \"4. Verify CAKE balance increased\", \"\", \"Contract details:\", \"- SimpleRewardPool contract address: pool_address (dynamic parameter)\", \"- Reward token: CAKE (0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82)\", \"- Harvest function signature: harvest() - no parameters\", \"\", \"To get the pool address from deployed contracts:\", \"const poolAddress = deployedContracts['simple_reward_pool']\", \"\", \"Function call construction:\", \"```typescript\", \"const SimpleRewardPoolABI = [\", \" 'function harvest() external'\", \"];\", \"const contract = new Contract interface(poolAddress, SimpleRewardPoolABI, provider);\", \"const data = encode the function call('harvest', []);\", \"```\", \"\", \"Common mistakes to avoid:\", \"- DO NOT pass any parameters to harvest() - it's a parameterless function\", \"- DO ensure you have pending rewards before harvesting\", \"- DO check the reward token (CAKE) balance before and after\"], \"difficulty\": \"medium\", \"expected_behavior\": {\"gas_estimate\": 100000, \"state_changes\": [\"User's CAKE balance increases by pending rewards\", \"Pending rewards reset to 0 after harvest\"], \"transaction_count\": 1}, \"hints\": [\"Use the harvest() function with no parameters\", \"Check pendingReward() before harvesting to see expected amount\", \"Verify CAKE balance increases after harvest\"], \"id\": \"harvest_rewards\", \"natural_language_templates\": [\"Harvest farming rewards from the pool at {pool_address}\", \"Claim accumulated rewards from the farming pool\", \"Collect farming rewards without unstaking\", \"Harvest CAKE rewards from the staking pool\"], \"parameters\": {\"chain_id\": {\"description\": \"Blockchain network ID (56 for BSC Mainnet)\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"pool_address\": {\"description\": \"SimpleRewardPool contract address\", \"dynamic\": true, \"generation\": {\"env_key\": \"simple_reward_pool_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"reward_token_address\": {\"description\": \"Reward token address (CAKE)\", \"example\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"user_address\": {\"description\": \"User's wallet address\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}}, \"subcategory\": \"staking_farming\", \"tags\": [\"harvest\", \"farming\", \"rewards\", \"defi\", \"yield\"], \"test_script_template\": \"harvest_rewards.ts\", \"title\": \"Harvest Farming Rewards\", \"validation_criteria\": {\"reward_token_increase\": {\"description\": \"User's reward token (CAKE) balance increased\", \"weight\": 70}, \"transaction_success\": {\"description\": \"Transaction executed successfully without reverting\", \"weight\": 30}}, \"version\": \"2.0.0\"}"} {"id": "stake_lp_tokens", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "staking_farming", "difficulty": "medium", "title": "Stake LP Tokens to Farming Pool", "description": "Stake LP (Liquidity Provider) tokens to a SimpleLPStaking farming pool to earn rewards. LP tokens are obtained by providing liquidity to a DEX pair (e.g., USDT/BUSD on PancakeSwap).\n\nIMPORTANT: This is a SimpleLPStaking contract, NOT a MasterChef-style contract.\n- Contract function: deposit(uint256 _amount) - ONLY ONE PARAMETER\n- NO pool ID parameter required (unlike MasterChef)\n- The pool_address parameter is the SimpleLPStaking contract address\n\nRequired steps:\n1. Check LP token balance: lpToken.balanceOf(user_address)\n2. Check current allowance: lpToken.allowance(user_address, pool_address)\n3. If allowance is insufficient, approve the pool: lpToken.approve(pool_address, amount)\n4. Stake LP tokens: simpleLPStaking.deposit(amount)\n\nContract details:\n- SimpleLPStaking contract address: pool_address (dynamic parameter)\n- LP token address: lp_token_address (USDT/BUSD pair: 0x7EFaEf62fDdCCa950418312c6C91Aef321375A00)\n- Deposit function signature: deposit(uint256 _amount)\n- Amount unit: wei (e.g., 0.5 LP tokens = 500000000000000000 wei)\n\nFunction call construction:\n```typescript\nconst SimpleLPStakingABI = [\n 'function deposit(uint256 _amount) external'\n];\nconst contract = new Contract interface(pool_address, SimpleLPStakingABI, provider);\nconst data = encode the function call('deposit', [amountInWei]);\n```\n\nCommon mistakes to avoid:\n- DO NOT use deposit(uint256 _pid, uint256 _amount) - this is MasterChef, not SimpleLPStaking\n- DO NOT pass a pool ID parameter\n- DO ensure the LP token is approved before calling deposit\n- DO convert the stake_amount to wei (multiply by 10^18)", "natural_language_templates": ["Stake {stake_amount} USDT/BUSD LP tokens in the SimpleLPStaking pool", "Deposit {stake_amount} LP tokens to the LP staking pool to earn farming rewards", "Stake {stake_amount} USDT/BUSD LP tokens using the simple_lp_staking contract", "Put {stake_amount} liquidity provider tokens into the LP staking pool to start earning"], "chain": "BSC", "network": "mainnet", "tags": ["staking", "farming", "lp_tokens", "defi", "yield"], "parameter_names": ["chain_id", "lp_token_address", "pool_address", "stake_amount", "user_address"], "parameters": "{\"chain_id\": {\"description\": \"Blockchain network ID (56 for BSC Mainnet)\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"lp_token_address\": {\"description\": \"LP token address (USDT/BUSD pair)\", \"example\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"pool_address\": {\"description\": \"SimpleLPStaking contract address\", \"dynamic\": true, \"generation\": {\"env_key\": \"simple_lp_staking_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"stake_amount\": {\"description\": \"Amount of LP tokens to stake (in LP token units, e.g., 0.5)\", \"example\": 0.5, \"generation\": {\"decimals\": 1, \"max\": 0.8, \"method\": \"random\", \"min\": 0.2}, \"range\": [0.1, 1.0], \"role\": \"transfer_amount\", \"type\": \"number\"}, \"user_address\": {\"description\": \"User's wallet address\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}}", "validation": "{}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{}", "source_path": "defi_operations/staking_farming/stake_lp_tokens.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"defi_operations\", \"contracts\": {\"lp_token\": {\"abi_functions\": [\"function approve(address spender, uint256 amount) external returns (bool)\", \"function allowance(address owner, address spender) external view returns (uint256)\", \"function balanceOf(address account) external view returns (uint256)\"], \"address\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\", \"name\": \"PancakeSwap LP Token (USDT/BUSD)\"}, \"simple_lp_staking\": {\"abi_functions\": [\"function deposit(uint256 _amount) external\", \"function withdraw(uint256 _amount) external\", \"function getUserInfo(address _user) external view returns (uint256 amount, uint256 depositTime)\", \"function userInfo(address _user) external view returns (uint256 amount, uint256 depositTime)\"], \"address\": \"dynamic\", \"name\": \"SimpleLPStaking\"}}, \"description\": [\"Stake LP (Liquidity Provider) tokens to a SimpleLPStaking farming pool to earn rewards. LP tokens are obtained by providing liquidity to a DEX pair (e.g., USDT/BUSD on PancakeSwap).\", \"\", \"IMPORTANT: This is a SimpleLPStaking contract, NOT a MasterChef-style contract.\", \"- Contract function: deposit(uint256 _amount) - ONLY ONE PARAMETER\", \"- NO pool ID parameter required (unlike MasterChef)\", \"- The pool_address parameter is the SimpleLPStaking contract address\", \"\", \"Required steps:\", \"1. Check LP token balance: lpToken.balanceOf(user_address)\", \"2. Check current allowance: lpToken.allowance(user_address, pool_address)\", \"3. If allowance is insufficient, approve the pool: lpToken.approve(pool_address, amount)\", \"4. Stake LP tokens: simpleLPStaking.deposit(amount)\", \"\", \"Contract details:\", \"- SimpleLPStaking contract address: pool_address (dynamic parameter)\", \"- LP token address: lp_token_address (USDT/BUSD pair: 0x7EFaEf62fDdCCa950418312c6C91Aef321375A00)\", \"- Deposit function signature: deposit(uint256 _amount)\", \"- Amount unit: wei (e.g., 0.5 LP tokens = 500000000000000000 wei)\", \"\", \"Function call construction:\", \"```typescript\", \"const SimpleLPStakingABI = [\", \" 'function deposit(uint256 _amount) external'\", \"];\", \"const contract = new Contract interface(pool_address, SimpleLPStakingABI, provider);\", \"const data = encode the function call('deposit', [amountInWei]);\", \"```\", \"\", \"Common mistakes to avoid:\", \"- DO NOT use deposit(uint256 _pid, uint256 _amount) - this is MasterChef, not SimpleLPStaking\", \"- DO NOT pass a pool ID parameter\", \"- DO ensure the LP token is approved before calling deposit\", \"- DO convert the stake_amount to wei (multiply by 10^18)\"], \"difficulty\": \"medium\", \"expected_behavior\": {\"gas_estimate\": 150000, \"state_changes\": [\"LP token balance decreases by stake_amount\", \"LP token allowance to pool decreases (or needs to be set)\", \"User's staked amount in pool increases by stake_amount\"], \"transaction_count\": 1}, \"hints\": [\"You need to approve the farming pool contract before staking LP tokens\", \"Use the deposit() function with the amount in wei (amount * 10^18)\", \"Check the current allowance first to avoid unnecessary approve transactions\", \"Query userInfo() to verify the staked amount after transaction\"], \"id\": \"stake_lp_tokens\", \"natural_language_templates\": [\"Stake {stake_amount} USDT/BUSD LP tokens in the SimpleLPStaking pool\", \"Deposit {stake_amount} LP tokens to the LP staking pool to earn farming rewards\", \"Stake {stake_amount} USDT/BUSD LP tokens using the simple_lp_staking contract\", \"Put {stake_amount} liquidity provider tokens into the LP staking pool to start earning\"], \"parameters\": {\"chain_id\": {\"description\": \"Blockchain network ID (56 for BSC Mainnet)\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"lp_token_address\": {\"description\": \"LP token address (USDT/BUSD pair)\", \"example\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"pool_address\": {\"description\": \"SimpleLPStaking contract address\", \"dynamic\": true, \"generation\": {\"env_key\": \"simple_lp_staking_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"stake_amount\": {\"description\": \"Amount of LP tokens to stake (in LP token units, e.g., 0.5)\", \"example\": 0.5, \"generation\": {\"decimals\": 1, \"max\": 0.8, \"method\": \"random\", \"min\": 0.2}, \"range\": [0.1, 1.0], \"role\": \"transfer_amount\", \"type\": \"number\"}, \"user_address\": {\"description\": \"User's wallet address\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}}, \"subcategory\": \"staking_farming\", \"tags\": [\"staking\", \"farming\", \"lp_tokens\", \"defi\", \"yield\"], \"test_script_template\": \"stake_lp_tokens.ts\", \"title\": \"Stake LP Tokens to Farming Pool\", \"validation_criteria\": {\"lp_balance_decrease\": {\"description\": \"User's LP token balance decreased by correct amount\", \"weight\": 25}, \"lp_token_approval\": {\"description\": \"LP token properly approved for farming pool contract\", \"weight\": 20}, \"staking_balance_increase\": {\"description\": \"User's staked balance in pool increased correctly\", \"weight\": 30}, \"transaction_success\": {\"description\": \"Transaction executed successfully without reverting\", \"weight\": 25}}, \"version\": \"2.0.0\"}"} {"id": "stake_single_token", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "staking_farming", "difficulty": "medium", "title": "Stake Single Token to Syrup Pool", "description": "Stake CAKE tokens to a PancakeSwap Syrup Pool to earn rewards. This operation requires approving the Syrup Pool contract to spend your CAKE tokens, then calling the deposit function with the pool ID and amount. You need to query the pool information to get the staking token address and ensure you have sufficient balance and allowance.", "natural_language_templates": ["Stake {stake_amount} CAKE tokens in the SimpleStaking pool", "Deposit {stake_amount} CAKE to the simple_staking contract to earn rewards", "Put {stake_amount} CAKE tokens into the single-token staking pool", "Stake {stake_amount} CAKE in the single token farming pool to start earning"], "chain": "BSC", "network": "mainnet", "tags": ["staking", "farming", "pancakeswap", "defi", "yield"], "parameter_names": ["chain_id", "pool_address", "stake_amount", "token_address", "user_address"], "parameters": "{\"chain_id\": {\"description\": \"Blockchain network ID (56 for BSC Mainnet)\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"pool_address\": {\"description\": \"SimpleStaking contract address\", \"dynamic\": true, \"generation\": {\"env_key\": \"simple_staking_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"stake_amount\": {\"description\": \"Amount of CAKE to stake (in CAKE units, e.g., 5.0)\", \"example\": 5.0, \"generation\": {\"decimals\": 1, \"max\": 8.0, \"method\": \"random\", \"min\": 2.0}, \"range\": [1.0, 10.0], \"role\": \"transfer_amount\", \"type\": \"number\"}, \"token_address\": {\"description\": \"CAKE token address (staking token)\", \"example\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"user_address\": {\"description\": \"User's wallet address\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}}", "validation": "{}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{}", "source_path": "defi_operations/staking_farming/stake_single_token.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"defi_operations\", \"contracts\": {\"cake_token\": {\"abi_functions\": [\"function approve(address spender, uint256 amount) external returns (bool)\", \"function allowance(address owner, address spender) external view returns (uint256)\", \"function balanceOf(address account) external view returns (uint256)\"], \"address\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\", \"name\": \"PancakeSwap Token (CAKE)\"}, \"simple_staking\": {\"abi_functions\": [\"function deposit(uint256 _amount) external\", \"function withdraw(uint256 _amount) external\", \"function getUserInfo(address _user) external view returns (uint256 amount, uint256 depositTime)\", \"function userInfo(address _user) external view returns (uint256 amount, uint256 depositTime)\"], \"address\": \"dynamic\", \"name\": \"SimpleStaking\"}}, \"description\": \"Stake CAKE tokens to a PancakeSwap Syrup Pool to earn rewards. This operation requires approving the Syrup Pool contract to spend your CAKE tokens, then calling the deposit function with the pool ID and amount. You need to query the pool information to get the staking token address and ensure you have sufficient balance and allowance.\", \"difficulty\": \"medium\", \"expected_behavior\": {\"gas_estimate\": 150000, \"state_changes\": [\"CAKE token balance decreases by stake_amount\", \"CAKE token allowance to pool decreases (or needs to be set)\", \"User's staked amount in pool increases by stake_amount\"], \"transaction_count\": 1}, \"hints\": [\"You need to approve the Syrup Pool contract before staking\", \"Use the deposit() function with the amount in wei (amount * 10^18)\", \"Check the current allowance first to avoid unnecessary approve transactions\", \"Query userInfo() to verify the staked amount after transaction\"], \"id\": \"stake_single_token\", \"natural_language_templates\": [\"Stake {stake_amount} CAKE tokens in the SimpleStaking pool\", \"Deposit {stake_amount} CAKE to the simple_staking contract to earn rewards\", \"Put {stake_amount} CAKE tokens into the single-token staking pool\", \"Stake {stake_amount} CAKE in the single token farming pool to start earning\"], \"parameters\": {\"chain_id\": {\"description\": \"Blockchain network ID (56 for BSC Mainnet)\", \"example\": 56, \"generation\": {\"method\": \"fixed\", \"value\": 56}, \"role\": \"parameter\", \"type\": \"integer\"}, \"pool_address\": {\"description\": \"SimpleStaking contract address\", \"dynamic\": true, \"generation\": {\"env_key\": \"simple_staking_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}, \"stake_amount\": {\"description\": \"Amount of CAKE to stake (in CAKE units, e.g., 5.0)\", \"example\": 5.0, \"generation\": {\"decimals\": 1, \"max\": 8.0, \"method\": \"random\", \"min\": 2.0}, \"range\": [1.0, 10.0], \"role\": \"transfer_amount\", \"type\": \"number\"}, \"token_address\": {\"description\": \"CAKE token address (staking token)\", \"example\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\"}, \"role\": \"receiver\", \"type\": \"address\"}, \"user_address\": {\"description\": \"User's wallet address\", \"dynamic\": true, \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"address\", \"type\": \"address\"}}, \"subcategory\": \"staking_farming\", \"tags\": [\"staking\", \"farming\", \"pancakeswap\", \"defi\", \"yield\"], \"test_script_template\": \"stake_single_token.ts\", \"title\": \"Stake Single Token to Syrup Pool\", \"validation_criteria\": {\"staking_balance_increase\": {\"description\": \"User's staked balance in pool increased correctly\", \"weight\": 30}, \"token_approval\": {\"description\": \"CAKE token properly approved for Syrup Pool contract\", \"weight\": 20}, \"token_balance_decrease\": {\"description\": \"User's CAKE balance decreased by correct amount\", \"weight\": 25}, \"transaction_success\": {\"description\": \"Transaction executed successfully without reverting\", \"weight\": 25}}, \"version\": \"2.0.0\"}"} {"id": "unstake_lp_tokens", "split": "atomic", "task_type": "atomic", "version": "2.0.0", "category": "defi_operations", "subcategory": "staking_farming", "difficulty": "medium", "title": "Unstake LP Tokens from Farming Pool", "description": "Withdraw (unstake) LP tokens from a farming pool. This operation retrieves your staked LP tokens back to your wallet.\n\nTechnical context:\n- Uses SimpleRewardPool contract's withdraw() function\n- Function signature: withdraw(uint256 _amount)\n- The withdraw function will also automatically harvest any pending rewards\n- LP tokens are returned to the user's wallet\n- Staked balance in the pool decreases by the withdrawal amount\n\nKey considerations:\n- Amount must not exceed the staked balance\n- Amount must be in wei (18 decimals for LP tokens)\n- Can withdraw partial or full staked amount\n- The pool automatically harvests rewards during withdrawal\n\nImplementation steps:\n1. Query current staked amount: rewardPool.userInfo(user_address)\n2. Ensure unstake amount <= staked amount\n3. Call withdraw: rewardPool.withdraw(amountInWei)\n4. Verify LP token balance increased by unstake amount\n5. Verify staked amount decreased by unstake amount", "natural_language_templates": ["Unstake {unstake_amount} USDT/BUSD LP tokens from the SimpleRewardPool", "Withdraw {unstake_amount} LP tokens from the simple_reward_pool contract", "Remove {unstake_amount} LP tokens from the reward pool staking", "Unstake {unstake_amount} USDT/BUSD LP tokens from the reward distribution pool"], "chain": "BSC", "network": "mainnet", "tags": ["unstake", "withdraw", "farming", "lp-tokens", "defi", "staking"], "parameter_names": ["lp_token_address", "pool_address", "unstake_amount", "user_address"], "parameters": "{\"lp_token_address\": {\"description\": \"LP token contract address (USDT/BUSD pair)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\"}, \"role\": \"staked_token\", \"type\": \"address\"}, \"pool_address\": {\"description\": \"SimpleRewardPool contract address\", \"generation\": {\"env_key\": \"simple_reward_pool_address\", \"method\": \"from_env\"}, \"role\": \"staking_contract\", \"type\": \"address\"}, \"unstake_amount\": {\"description\": \"Amount of LP tokens to unstake\", \"generation\": {\"decimals\": 1, \"max\": 0.4, \"method\": \"random\", \"min\": 0.2}, \"role\": \"withdrawal_amount\", \"type\": \"number\", \"unit\": \"LP_token\"}, \"user_address\": {\"description\": \"User's wallet address\", \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"staker\", \"type\": \"address\"}}", "validation": "{}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"contract_type\": \"SimpleRewardPool\", \"estimated_gas\": 150000, \"network\": \"mainnet\", \"notes\": [\"The withdraw function also harvests pending rewards automatically\", \"Focus is on LP token withdrawal, rewards are a side effect\", \"Partial withdrawal is supported\"], \"requires_contract\": true, \"tags\": [\"unstake\", \"withdraw\", \"farming\", \"lp-tokens\", \"defi\", \"staking\"]}", "source_path": "defi_operations/staking_farming/unstake_lp_tokens.json", "raw_definition": "{\"blockchain\": {\"chain\": \"BSC\", \"network\": \"mainnet\"}, \"category\": \"defi_operations\", \"description\": [\"Withdraw (unstake) LP tokens from a farming pool. This operation retrieves your staked LP tokens back to your wallet.\", \"\", \"Technical context:\", \"- Uses SimpleRewardPool contract's withdraw() function\", \"- Function signature: withdraw(uint256 _amount)\", \"- The withdraw function will also automatically harvest any pending rewards\", \"- LP tokens are returned to the user's wallet\", \"- Staked balance in the pool decreases by the withdrawal amount\", \"\", \"Key considerations:\", \"- Amount must not exceed the staked balance\", \"- Amount must be in wei (18 decimals for LP tokens)\", \"- Can withdraw partial or full staked amount\", \"- The pool automatically harvests rewards during withdrawal\", \"\", \"Implementation steps:\", \"1. Query current staked amount: rewardPool.userInfo(user_address)\", \"2. Ensure unstake amount <= staked amount\", \"3. Call withdraw: rewardPool.withdraw(amountInWei)\", \"4. Verify LP token balance increased by unstake amount\", \"5. Verify staked amount decreased by unstake amount\"], \"difficulty\": \"medium\", \"id\": \"unstake_lp_tokens\", \"metadata\": {\"contract_type\": \"SimpleRewardPool\", \"estimated_gas\": 150000, \"network\": \"mainnet\", \"notes\": [\"The withdraw function also harvests pending rewards automatically\", \"Focus is on LP token withdrawal, rewards are a side effect\", \"Partial withdrawal is supported\"], \"requires_contract\": true, \"tags\": [\"unstake\", \"withdraw\", \"farming\", \"lp-tokens\", \"defi\", \"staking\"]}, \"natural_language_templates\": [\"Unstake {unstake_amount} USDT/BUSD LP tokens from the SimpleRewardPool\", \"Withdraw {unstake_amount} LP tokens from the simple_reward_pool contract\", \"Remove {unstake_amount} LP tokens from the reward pool staking\", \"Unstake {unstake_amount} USDT/BUSD LP tokens from the reward distribution pool\"], \"parameters\": {\"lp_token_address\": {\"description\": \"LP token contract address (USDT/BUSD pair)\", \"generation\": {\"method\": \"fixed\", \"value\": \"0x7EFaEf62fDdCCa950418312c6C91Aef321375A00\"}, \"role\": \"staked_token\", \"type\": \"address\"}, \"pool_address\": {\"description\": \"SimpleRewardPool contract address\", \"generation\": {\"env_key\": \"simple_reward_pool_address\", \"method\": \"from_env\"}, \"role\": \"staking_contract\", \"type\": \"address\"}, \"unstake_amount\": {\"description\": \"Amount of LP tokens to unstake\", \"generation\": {\"decimals\": 1, \"max\": 0.4, \"method\": \"random\", \"min\": 0.2}, \"role\": \"withdrawal_amount\", \"type\": \"number\", \"unit\": \"LP_token\"}, \"user_address\": {\"description\": \"User's wallet address\", \"generation\": {\"env_key\": \"test_address\", \"method\": \"from_env\"}, \"role\": \"staker\", \"type\": \"address\"}}, \"post_conditions\": [{\"description\": \"Withdraw transaction executed successfully\", \"type\": \"transaction_success\", \"weight\": 0.3}, {\"address\": \"{user_address}\", \"description\": \"LP token balance increased correctly\", \"expected_change\": \"+{unstake_amount}\", \"token\": \"{lp_token_address}\", \"tolerance\": \"0.01\", \"type\": \"token_balance_change\", \"weight\": 0.4}, {\"description\": \"Staked amount decreased correctly\", \"expected_change\": \"-{unstake_amount}\", \"pool\": \"{pool_address}\", \"tolerance\": \"0.01\", \"type\": \"staked_balance_change\", \"user\": \"{user_address}\", \"weight\": 0.3}], \"pre_conditions\": [{\"description\": \"User must have sufficient staked balance\", \"min_staked\": \"{unstake_amount}\", \"pool\": \"{pool_address}\", \"type\": \"staked_balance_check\", \"user\": \"{user_address}\"}], \"subcategory\": \"staking_farming\", \"title\": \"Unstake LP Tokens from Farming Pool\", \"version\": \"2.0.0\"}"} {"id": "query_pending_rewards", "split": "atomic", "task_type": "atomic", "version": "", "category": "defi_operations", "subcategory": "staking_queries", "difficulty": "medium", "title": "Query Pending Rewards", "description": "Query the pending rewards earned by a user in a staking pool. This involves calling the SimpleRewardPool contract's pendingReward function to retrieve the accumulated rewards that can be harvested. Rewards accumulate over time based on the user's staked amount and the pool's reward rate.", "natural_language_templates": ["Query the pending rewards for address {{query_address}} in the SimpleRewardPool", "Check how much rewards {{query_address}} has earned in the reward pool at {{pool_address}}", "Get the accumulated rewards for user {{query_address}} from the SimpleRewardPool contract", "Retrieve pending CAKE rewards for address {{query_address}} that can be harvested"], "chain": "BSC", "network": "mainnet", "tags": ["defi", "staking", "farming", "rewards", "query", "pendingReward"], "parameter_names": ["expected_pending_rewards", "pool_address", "query_address", "reward_token_decimals"], "parameters": "{\"expected_pending_rewards\": {\"description\": \"Expected pending rewards amount (in token units, not wei)\", \"generation\": {\"decimals\": 3, \"max\": 50, \"method\": \"random\", \"min\": 0.1}, \"type\": \"number\"}, \"pool_address\": {\"description\": \"SimpleRewardPool contract address\", \"generation\": {\"env_key\": \"simple_reward_pool_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"query_address\": {\"description\": \"User address to query pending rewards for\", \"generation\": {\"method\": \"random\"}, \"type\": \"address\"}, \"reward_token_decimals\": {\"description\": \"Reward token decimals (CAKE uses 18 decimals)\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query pending rewards\", \"field\": \"query_execution\", \"weight\": 30}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"pending_rewards\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"Pending rewards do not match expected value (allowing 5% tolerance for time-based accumulation)\", \"field\": \"pending_rewards_correctness\", \"tolerance_percent\": 5, \"weight\": 40}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand how to query pending rewards from staking pools\", \"Learn to call pendingReward function to get accumulated rewards\", \"Master handling time-based reward accumulation\", \"Understand the difference between staked amount and earned rewards\", \"Learn proper unit conversion for reward tokens\"], \"notes\": [\"Rewards accumulate over time, so the exact value may vary slightly\", \"A 5% tolerance is used to account for time-based accumulation during test execution\", \"The pendingReward function is a view function and does not change state\"], \"operation_type\": \"query\", \"prerequisites\": [\"stake_single_token\", \"stake_lp_tokens\"], \"related_questions\": [\"query_staked_amount\", \"harvest_rewards\"], \"tags\": [\"defi\", \"staking\", \"farming\", \"rewards\", \"query\", \"pendingReward\"]}", "source_path": "defi_operations/staking_queries/query_pending_rewards.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"defi_operations\", \"description\": \"Query the pending rewards earned by a user in a staking pool. This involves calling the SimpleRewardPool contract's pendingReward function to retrieve the accumulated rewards that can be harvested. Rewards accumulate over time based on the user's staked amount and the pool's reward rate.\", \"difficulty\": \"medium\", \"id\": \"query_pending_rewards\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand how to query pending rewards from staking pools\", \"Learn to call pendingReward function to get accumulated rewards\", \"Master handling time-based reward accumulation\", \"Understand the difference between staked amount and earned rewards\", \"Learn proper unit conversion for reward tokens\"], \"notes\": [\"Rewards accumulate over time, so the exact value may vary slightly\", \"A 5% tolerance is used to account for time-based accumulation during test execution\", \"The pendingReward function is a view function and does not change state\"], \"operation_type\": \"query\", \"prerequisites\": [\"stake_single_token\", \"stake_lp_tokens\"], \"related_questions\": [\"query_staked_amount\", \"harvest_rewards\"], \"tags\": [\"defi\", \"staking\", \"farming\", \"rewards\", \"query\", \"pendingReward\"]}, \"natural_language_templates\": [\"Query the pending rewards for address {{query_address}} in the SimpleRewardPool\", \"Check how much rewards {{query_address}} has earned in the reward pool at {{pool_address}}\", \"Get the accumulated rewards for user {{query_address}} from the SimpleRewardPool contract\", \"Retrieve pending CAKE rewards for address {{query_address}} that can be harvested\"], \"parameters\": {\"expected_pending_rewards\": {\"description\": \"Expected pending rewards amount (in token units, not wei)\", \"generation\": {\"decimals\": 3, \"max\": 50, \"method\": \"random\", \"min\": 0.1}, \"type\": \"number\"}, \"pool_address\": {\"description\": \"SimpleRewardPool contract address\", \"generation\": {\"env_key\": \"simple_reward_pool_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"query_address\": {\"description\": \"User address to query pending rewards for\", \"generation\": {\"method\": \"random\"}, \"type\": \"address\"}, \"reward_token_decimals\": {\"description\": \"Reward token decimals (CAKE uses 18 decimals)\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}}, \"subcategory\": \"staking_queries\", \"title\": \"Query Pending Rewards\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query pending rewards\", \"field\": \"query_execution\", \"weight\": 30}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"pending_rewards\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"Pending rewards do not match expected value (allowing 5% tolerance for time-based accumulation)\", \"field\": \"pending_rewards_correctness\", \"tolerance_percent\": 5, \"weight\": 40}], \"type\": \"query\"}}"} {"id": "query_staked_amount", "split": "atomic", "task_type": "atomic", "version": "", "category": "defi_operations", "subcategory": "staking_queries", "difficulty": "easy", "title": "Query Staked Amount", "description": "Query the staked amount of a user in a staking contract. This involves calling the staking contract's userInfo function to retrieve the user's staked balance and deposit time.", "natural_language_templates": ["Query the staked amount for address {{query_address}} in the SimpleStaking contract", "Check how much {{query_address}} has staked in the staking pool at {{pool_address}}", "Get the staked balance for user {{query_address}} from the SimpleStaking contract", "Retrieve staking information for address {{query_address}} including amount and deposit time"], "chain": "BSC", "network": "mainnet", "tags": ["defi", "staking", "query", "userInfo"], "parameter_names": ["expected_staked_amount", "pool_address", "query_address", "token_decimals"], "parameters": "{\"expected_staked_amount\": {\"description\": \"Expected staked amount (in token units, not wei)\", \"generation\": {\"decimals\": 2, \"max\": 100, \"method\": \"random\", \"min\": 1}, \"type\": \"number\"}, \"pool_address\": {\"description\": \"SimpleStaking contract address\", \"generation\": {\"env_key\": \"simple_staking_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"query_address\": {\"description\": \"User address to query staked amount for\", \"generation\": {\"method\": \"random\"}, \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Staking token decimals (CAKE uses 18 decimals)\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}}", "validation": "{\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query staked amount\", \"field\": \"query_execution\", \"weight\": 30}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"staked_amount\", \"deposit_time\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"Staked amount does not match expected value\", \"field\": \"staked_amount_correctness\", \"tolerance_percent\": 1, \"weight\": 40}], \"type\": \"query\"}", "composite_structure": "{}", "interaction_config": "{}", "scoring_strategy": "{}", "metadata": "{\"estimated_gas\": 0, \"learning_objectives\": [\"Understand how to query staking contract state\", \"Learn to call userInfo function to get user's staked balance\", \"Master parsing struct return values from smart contracts\", \"Understand the structure of staking data (amount, depositTime)\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"stake_single_token\", \"unstake_lp_tokens\"], \"tags\": [\"defi\", \"staking\", \"query\", \"userInfo\"]}", "source_path": "defi_operations/staking_queries/query_staked_amount.json", "raw_definition": "{\"blockchain\": \"bsc\", \"category\": \"defi_operations\", \"description\": \"Query the staked amount of a user in a staking contract. This involves calling the staking contract's userInfo function to retrieve the user's staked balance and deposit time.\", \"difficulty\": \"easy\", \"id\": \"query_staked_amount\", \"metadata\": {\"estimated_gas\": 0, \"learning_objectives\": [\"Understand how to query staking contract state\", \"Learn to call userInfo function to get user's staked balance\", \"Master parsing struct return values from smart contracts\", \"Understand the structure of staking data (amount, depositTime)\"], \"operation_type\": \"query\", \"prerequisites\": [], \"related_questions\": [\"stake_single_token\", \"unstake_lp_tokens\"], \"tags\": [\"defi\", \"staking\", \"query\", \"userInfo\"]}, \"natural_language_templates\": [\"Query the staked amount for address {{query_address}} in the SimpleStaking contract\", \"Check how much {{query_address}} has staked in the staking pool at {{pool_address}}\", \"Get the staked balance for user {{query_address}} from the SimpleStaking contract\", \"Retrieve staking information for address {{query_address}} including amount and deposit time\"], \"parameters\": {\"expected_staked_amount\": {\"description\": \"Expected staked amount (in token units, not wei)\", \"generation\": {\"decimals\": 2, \"max\": 100, \"method\": \"random\", \"min\": 1}, \"type\": \"number\"}, \"pool_address\": {\"description\": \"SimpleStaking contract address\", \"generation\": {\"env_key\": \"simple_staking_address\", \"method\": \"from_env\"}, \"type\": \"address\"}, \"query_address\": {\"description\": \"User address to query staked amount for\", \"generation\": {\"method\": \"random\"}, \"type\": \"address\"}, \"token_decimals\": {\"description\": \"Staking token decimals (CAKE uses 18 decimals)\", \"generation\": {\"method\": \"fixed\", \"value\": 18}, \"type\": \"integer\"}}, \"subcategory\": \"staking_queries\", \"title\": \"Query Staked Amount\", \"validation\": {\"rules\": [{\"condition\": \"success\", \"error_message\": \"Failed to query staked amount\", \"field\": \"query_execution\", \"weight\": 30}, {\"condition\": \"has_required_fields\", \"error_message\": \"Missing required fields in query result\", \"field\": \"return_format\", \"required_fields\": [\"staked_amount\", \"deposit_time\"], \"weight\": 30}, {\"condition\": \"matches_expected\", \"error_message\": \"Staked amount does not match expected value\", \"field\": \"staked_amount_correctness\", \"tolerance_percent\": 1, \"weight\": 40}], \"type\": \"query\"}}"}