File size: 3,700 Bytes
edbc049
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
  "id": "composite_wrap_unwrap_cycle",
  "version": "1.0.0",
  "category": "composite_problems",
  "subcategory": "wrap_unwrap",
  "difficulty": "easy",
  "title": "Wrap BNB and Unwrap Back to BNB (Cycle Test)",
  "natural_language_templates": [
    "Wrap {amount} BNB to WBNB, then immediately unwrap all WBNB back to BNB",
    "Deposit {amount} BNB to WBNB and withdraw it back to BNB",
    "Convert {amount} BNB to WBNB, then convert it back to native BNB"
  ],
  "description": [
    "Test the WBNB wrap/unwrap functionality by wrapping BNB and immediately unwrapping it.",
    "",
    "This is a 2-step process:",
    "1. Deposit BNB to WBNB contract using deposit() function",
    "2. Withdraw WBNB back to BNB using withdraw(uint256) function",
    "",
    "Technical details:",
    "- WBNB contract address: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "- deposit() function: 0xd0e30db0 (payable)",
    "- withdraw(uint256) function: 0x2e1a7d4d",
    "",
    "Note: This is a test case to verify wrap/unwrap functionality works correctly.",
    "The key operation is wbnb_withdraw since the final goal is to get BNB back."
  ],
  "composite_structure": {
    "pattern": "wrap-unwrap",
    "optimal_steps": 2,
    "atomic_operations": [
      {
        "step": 1,
        "atomic_id": "wbnb_deposit",
        "role": "wrap_bnb",
        "description": "Wrap BNB to WBNB by calling deposit() on WBNB contract"
      },
      {
        "step": 2,
        "atomic_id": "wbnb_withdraw",
        "role": "key_operation",
        "description": "Withdraw WBNB to get native BNB back"
      }
    ]
  },
  "parameters": {
    "wbnb_address": {
      "type": "address",
      "role": "contract",
      "description": "WBNB contract address",
      "generation": {
        "method": "fixed",
        "value": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
      }
    },
    "amount": {
      "type": "number",
      "unit": "BNB",
      "description": "Amount of BNB to wrap and unwrap",
      "generation": {
        "method": "random",
        "min": 0.01,
        "max": 0.1,
        "decimals": 3
      },
      "role": "wrap_amount"
    }
  },
  "interaction_config": {
    "max_rounds": 4,
    "optimal_steps": 2,
    "score_decay_formula": "base_score * min(1.0, optimal_steps / actual_steps)",
    "forced_submit_at_max": true
  },
  "scoring_strategy": {
    "method": "atomic_validator_reuse",
    "key_operation_id": "wbnb_withdraw",
    "key_operation_step": 2
  },
  "validation": {
    "pre_conditions": [
      {
        "type": "bnb_balance",
        "description": "Agent must have sufficient BNB for wrap and gas",
        "min_balance": "1 BNB"
      }
    ],
    "post_conditions": [
      {
        "type": "transaction_success",
        "weight": 0.3,
        "description": "Withdraw transaction executed successfully"
      },
      {
        "type": "contract_called",
        "weight": 0.2,
        "address": "{wbnb_address}",
        "description": "Correct WBNB contract called"
      },
      {
        "type": "function_selector",
        "weight": 0.2,
        "selector": "0x2e1a7d4d",
        "description": "Correct function withdraw(uint256) called"
      },
      {
        "type": "bnb_balance_recovered",
        "weight": 0.3,
        "description": "BNB balance recovered (minus gas costs)"
      }
    ]
  },
  "metadata": {
    "tags": [
      "wrap-unwrap",
      "test",
      "wbnb",
      "cycle",
      "easy",
      "two-step"
    ],
    "estimated_gas": 120000,
    "requires_approval": false,
    "difficulty_notes": [
      "Simple two-step process",
      "Tests basic WBNB wrap/unwrap functionality",
      "No approval required"
    ]
  }
}