refactor(curve): stateless contracts as state attribute instead of static.

This commit is contained in:
Florian Pellissier
2024-08-15 10:42:06 +02:00
parent 420cf13466
commit c218252548
7 changed files with 775 additions and 679 deletions

View File

@@ -50,7 +50,6 @@ tests:
- "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
static_attributes:
factory: "0x307830303030303030303030303030303030303030303030303030303030303030303030303030303030" # 0x0000000000000000000000000000000000000000
stateless_contract_addr_0: "0x307838663638663438313063636533313934623663623666336435306661353863326339626464316435" # 0x8f68f4810cce3194b6cb6f3d50fa58c2c9bdd1d5
factory_name: "0x6e61" # na
name: "0x74726963727970746f32" # tricrypto2
creation_tx: "0xdafb6385ed988ce8aacecfe1d97b38ea5e60b1ebce74d2423f71ddd621680138"
@@ -108,13 +107,12 @@ tests:
factory: "0x307836613863626564373536383034623136653035653734316564616264356362353434616532316266" # 0x6a8cbed756804b16e05e741edabd5cb544ae21bf
factory_name: "0x63727970746f5f737761705f6e675f666163746f7279" # crypto_swap_ng_factory
name: "0x757364652d75736463" # usde-usdc
stateless_contract_addr_0: "0x63616c6c3a3078366138636265643735363830346231366530356537343165646162643563623534346165323162663a76696577735f696d706c656d656e746174696f6e2829" # call:0x6a8cbed756804b16e05e741edabd5cb544ae21bf:views_implementation()
pool_type: "0x706c61696e5f706f6f6c" # plain_pool
creation_tx: "0x6f4438aa1785589e2170599053a0cdc740d8987746a4b5ad9614b6ab7bb4e550"
skip_simulation: false
# CryptoSwapNG factory 0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf - MetaPool
- name: test_crypto_swap_ng_factory_meta_pool
- name: test_crypto_swap_ng_factory_metapool
start_block: 19216042
stop_block: 19217045
initialized_accounts:
@@ -129,8 +127,6 @@ tests:
factory_name: "0x63727970746f5f737761705f6e675f666163746f7279" # crypto_swap_ng_factory
name: "0x646f6c612f667261787079757364" # dola/fraxpyusd
pool_type: "0x6d657461706f6f6c" # metapool
stateless_contract_addr_0: "0x63616c6c3a3078366138636265643735363830346231366530356537343165646162643563623534346165323162663a76696577735f696d706c656d656e746174696f6e2829" # call:0x6a8cbed756804b16e05e741edabd5cb544ae21bf:views_implementation()
stateless_contract_addr_1: "0x63616c6c3a3078366138636265643735363830346231366530356537343165646162643563623534346165323162663a6d6174685f696d706c656d656e746174696f6e2829" # call:0x6a8cbed756804b16e05e741edabd5cb544ae21bf:math_implementation()
base_pool: "0x307861353538386637636466353630383131373130613264383264336339633939373639646231646362" # 0xa5588f7cdf560811710a2d82d3c9c99769db1dcb
factory: "0x307836613863626564373536383034623136653035653734316564616264356362353434616532316266" # 0x6a8cbed756804b16e05e741edabd5cb544ae21bf
creation_tx: "0x3cfeecae1b43086ee5705f89b803e21eb0492d7d5db06c229586db8fc72f5665"
@@ -154,7 +150,6 @@ tests:
base_pool: "0x307864636566393638643431366134316364616330656438373032666163383132386136343234316132" # 0xdcfe968d416ac0ed8702fac8128a64241a2
factory: "0x307862396663313537333934616638303461333537383133346136353835633064633963633939306434" # 0xb9fc157394af804a3578134a6585c0dcc993099d
pool_type: "0x6d657461706f6f6c" # metapool
stateless_contract_addr_0: "0x307833336262306536326435653863363838653634356464343664666234386364363133323530303637" # 0x33bb0e62d5e8c688e645dd46dfb48cd613250067
creation_tx: "0xc9c6b879cbb19f7f26405335c3879c350592d530956878ff172e9efad786c63f"
skip_simulation: true # Reason: this pool calls `totalSupply()` on the LP token during simulation. But this token is overridden and doesn't have anything for totalSupply
@@ -162,6 +157,8 @@ tests:
- name: test_metapool_factory_plainpool
start_block: 18808555
stop_block: 18818577
initialized_accounts:
- "0xc4ad29ba4b3c580e6d59105fff484999997675ff" # Needed by another component that is created within this block range
expected_components:
- id: "0xf2DCf6336D8250754B4527f57b275b19c8D5CF88"
tokens:
@@ -172,7 +169,6 @@ tests:
factory: "0x307862396663313537333934616638303461333537383133346136353835633064633963633939306434" # 0xb9fc157394af804a3578134a6585c0dcc993099d
factory_name: "0x6d6574615f706f6f6c5f666163746f7279" # meta_pool_factory
pool_type: "0x706c61696e5f706f6f6c" # plain_pool
stateless_contract_addr_0: "0x307863363239613031656332336162303465313035303530306133373137613261356330373031343937" # 0xc629a01ec23ab04e1050500a3717a2a5c0701497
creation_tx: "0xeb34c90d352f18ffcfe78b7e393e155f0314acf06c54d1ac9996e4ee5a9b4742"
skip_simulation: false
- id: "0x3f67dc2AdBA4B1beB6A48c30AB3AFb1c1440d35B"
@@ -184,7 +180,6 @@ tests:
factory: "0x307862396663313537333934616638303461333537383133346136353835633064633963633939306434" # 0xb9fc157394af804a3578134a6585c0dcc993099d
factory_name: "0x6d6574615f706f6f6c5f666163746f7279" # meta_pool_factory
pool_type: "0x706c61696e5f706f6f6c" # plain_pool
stateless_contract_addr_0: "0x307863363239613031656332336162303465313035303530306133373137613261356330373031343937" # 0xc629a01ec23ab04e1050500a3717a2a5c0701497
creation_tx: "0x455559b43afaf429c15c1d807fd7f5dd47be30f6411a854499f719b944f4c024"
skip_simulation: true # Reason: this pool has no liquidity at stop_block
@@ -203,8 +198,6 @@ tests:
factory: "0x307866313830353662626433323065393661343865336662663862633036313332323533316161633939" # 0xf18056bbd320e96a48e3fb8bc061322531aacc99
factory_name: "0x63727970746f5f706f6f6c5f666163746f7279" # crypto_pool_factory
lp_token: "0x6ade6971ca3d90990c30d39c78b0736c7166e07b" # 0x6ade6971ca3d90990c30d39c78b0736c7166e07b
stateless_contract_addr_1: "0x307863303835353061346363353333336634306535393365636334633437323438303830383564333034" # 0xc08550a4cc5333f40e593ecc4c4724808085d304
stateless_contract_addr_0: "0x307861383534363161666332646565633031626461323362356364323637643531663736356662613130" # 0xa85461afc2deec01bda23b5cd267d51f765fba10
creation_tx: "0xa89c09a7e0dfd84f3a294b8df4f33cc4a623e6d52deee357457afe2591ea596f"
skip_simulation: false
- id: "0x6c9Fe53cC13b125d6476E5Ce2b76983bd5b7A112"
@@ -217,8 +210,6 @@ tests:
factory: "0x307866313830353662626433323065393661343865336662663862633036313332323533316161633939" # 0xf18056bbd320e96a48e3fb8bc061322531aacc99
factory_name: "0x63727970746f5f706f6f6c5f666163746f7279" # crypto_pool_factory
lp_token: "0x94c4eba4f4b97be8d778f8c27027d676270e87a6" # 0x94c4eba4f4b97be8d778f8c27027d676270e87a6
stateless_contract_addr_1: "0x307863303835353061346363353333336634306535393365636334633437323438303830383564333034" # 0xc08550a4cc5333f40e593ecc4c4724808085d304
stateless_contract_addr_0: "0x307861383534363161666332646565633031626461323362356364323637643531663736356662613130" # 0xa85461afc2deec01bda23b5cd267d51f765fba10
creation_tx: "0xa5b13d50c56242f7994b8e1339032bb4c6f9ac3af3054d4eae3ce9e32e3c1a50"
skip_simulation: true # Reason: this pool has no liquidity at stop_block
@@ -237,8 +228,6 @@ tests:
factory: "0x307866313830353662626433323065393661343865336662663862633036313332323533316161633939" # 0xf18056bbd320e96a48e3fb8bc061322531aacc99
factory_name: "0x63727970746f5f706f6f6c5f666163746f7279" # crypto_pool_factory
lp_token: "0x393dad6c76d962abba489a77dbf37ae948a4a6ee" # 0x393dad6c76d962abba489a77dbf37ae948a4a6ee
stateless_contract_addr_0: "0x307861383534363161666332646565633031626461323362356364323637643531663736356662613130" # 0xa85461afc2deec01bda23b5cd267d51f765fba10
stateless_contract_addr_1: "0x307863303835353061346363353333336634306535393365636334633437323438303830383564333034" # 0xc08550a4cc5333f40e593ecc4c4724808085d304
creation_tx: "0x52f0f76d97e77579eebd32876de99f656930a99131dc4c4f1dec005786c8782b"
skip_simulation: false
@@ -259,8 +248,6 @@ tests:
factory: "0x307830633065356632666630666631386133626539623833353633353033393235366463346234393633" # 0x0c0e5f2ff0ff18a3be9b8356335039256dc4b4963
factory_name: "0x74726963727970746f5f666163746f7279" # tricrypto_factory
name: "0x74726963727970746f75736463" # tricrypto_usdc
stateless_contract_addr_0: "0x63616c6c3a3078306330653566326666306666313861336265396238333536333530333932353664633462343936333a76696577735f696d706c656d656e746174696f6e2829" # call:0x0c0e5f2ff0ff18a3be9b8356335039256dc4b4963:views_implementation()
stateless_contract_addr_1: "0x63616c6c3a3078306330653566326666306666313861336265396238333536333530333932353664633462343936333a6d6174685f696d706c656d656e746174696f6e2829" # call:0x0c0e5f2ff0ff18a3be9b8356335039256dc4b4963:math_implementation()
pool_type: "0x74726963727970746f" # tricrypto
creation_tx: "0x2bd59c19f993b83729fb23498f897a58567c6f0b3ee2f00613ba515a7b19fe23"
skip_simulation: false
@@ -280,8 +267,6 @@ tests:
factory: "0x307839386565383531613030616265653064393564303863663463613262646365333261656161663766" # 0x98ee851a00abee0d95d08cf4ca2bdce32aea7f7f
pool_type: "0x74776f63727970746f" # twocrypto
factory_name: "0x74776f63727970746f5f666163746f7279" # twocrypto_factory
stateless_contract_addr_0: "0x63616c6c3a3078393865653835316130306162656530643935643038636634636132626463653332616561616637663a76696577735f696d706c656d656e746174696f6e2829" # call:0x98ee851a00abee0d95d08cf4ca2bdce32aea7f7f:views_implementation()
stateless_contract_addr_1: "0x63616c6c3a3078393865653835316130306162656530643935643038636634636132626463653332616561616637663a6d6174685f696d706c656d656e746174696f6e2829" # call:0x98ee851a00abee0d95d08cf4ca2bdce32aea7f7f:math_implementation()
name: "0x7577752f77657468" # uwu/weth
creation_tx: "0x61d563e2627437da172fdd60ab54e5cc955fcb75829fd819486e857bac31cad2"
skip_simulation: false
@@ -302,7 +287,6 @@ tests:
pool_type: "0x706c61696e5f706f6f6c" # plain_pool
factory: "0x307834663838343661653933383062393064326537316435653364303432646666336537656262343064" # 0x4f8846ae9380b90d2e71d5e3d042dff3e7ebb40d
factory_name: "0x737461626c655f737761705f666163746f7279" # stable_swap_factory
stateless_contract_addr_0: "0x307836376665343161393465373739636366613232636666303263633239353764633963306534323836" # 0x67fe41a94e779ccfa22cff02cc2957dc9c0e4286
creation_tx: "0x40b25773bf8ea673434277d279af40a85b09072072e7004e9048a2ec0f0dd5a0"
skip_simulation: false
@@ -324,7 +308,6 @@ tests:
- "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490"
static_attributes:
factory_name: "0x6d6574615f706f6f6c5f666163746f7279" # meta_pool_factory
stateless_contract_addr_0: "0x307835663839303834316636353764393065303831626162646235333261303539393661663739666536" # 0x5f890841f657d90e081babdb532a05996af79fe6
base_pool: "0x307862656263343437383263376462306131613630636236666539376430623438333033326666316337" # 0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7
factory: "0x307830393539313538623630343064333264303463333031613732636266643662333965323163396165" # 0x0959158b6040d32d04c301a72cbfd6b39e21c9ae
pool_type: "0x6d657461706f6f6c" # metapool