Skip to content

Commit f086ef1

Browse files
feat: Vault leveraging aave on eth and pancake on base part 1 (#340)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 6d97dc7 commit f086ef1

File tree

21 files changed

+2394
-99
lines changed

21 files changed

+2394
-99
lines changed

contracts/encoders/evm-encoder/src/libraries/forwarder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use alloy_sol_types::{SolCall, SolValue};
22
use cosmwasm_schema::cw_serde;
3-
use cosmwasm_std::{Binary, StdError, StdResult};
3+
use cosmwasm_std::{Binary, StdError, StdResult, Uint256};
44
use valence_encoder_utils::libraries::{
55
forwarder::solidity_types::{forwardCall, IntervalType},
66
updateConfigCall,
@@ -31,7 +31,7 @@ pub struct ForwardingConfig {
3131
/// The address of the token to forward.
3232
pub token_address: String,
3333
/// The maximum amount to forward.
34-
pub max_amount: u128,
34+
pub max_amount: Uint256,
3535
}
3636

3737
type ForwarderMsg = ExecuteMsg<FunctionMsgs, LibraryConfig>;
@@ -65,7 +65,7 @@ pub fn encode(msg: &Binary) -> StdResult<Vec<u8>> {
6565
.map(|cfg| {
6666
Ok(valence_encoder_utils::libraries::forwarder::solidity_types::ForwardingConfig {
6767
tokenAddress: parse_address(&cfg.token_address)?,
68-
maxAmount: cfg.max_amount,
68+
maxAmount: alloy_primitives::U256::from_be_bytes(cfg.max_amount.to_be_bytes()),
6969
})
7070
})
7171
.collect::<StdResult<Vec<_>>>()?;

docs/src/libraries/evm/forwarder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The library is configured on deployment using the `ForwarderConfig` type.
4040
*/
4141
struct ForwardingConfig {
4242
address tokenAddress;
43-
uint128 maxAmount;
43+
uint256 maxAmount;
4444
}
4545
4646
/**

e2e/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ path = "examples/eth_cctp_vault/vault.rs"
1313
name = "eureka_vault"
1414
path = "examples/eth_eureka_vault/vault.rs"
1515

16+
[[example]]
17+
name = "eth_to_base_vault_pancake"
18+
path = "examples/eth_to_base_vault_pancake/vault.rs"
19+
1620
[dependencies]
1721
localic-std = { git = "https://github.com/strangelove-ventures/interchaintest", branch = "main" }
1822
localic-utils = { git = "https://github.com/timewave-computer/localic-utils", branch = "main" }

e2e/examples/eth_cctp_vault/evm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ pub fn setup_cctp_transfer(
171171
// Pad with zeroes to 32 bytes
172172
let padded_hex = format!("{:0>64}", address_hex);
173173

174-
let cctp_transer_cfg = CCTPTransferConfig {
174+
let cctp_transfer_cfg = CCTPTransferConfig {
175175
amount: U256::ZERO,
176176
mintRecipient: alloy_primitives_encoder::FixedBytes::<32>::from_hex(padded_hex)?,
177177
inputAccount: alloy_primitives_encoder::Address::from_str(
@@ -190,7 +190,7 @@ pub fn setup_cctp_transfer(
190190
&eth_rp,
191191
admin,
192192
processor,
193-
alloy_sol_types_encoder::SolValue::abi_encode(&cctp_transer_cfg).into(),
193+
alloy_sol_types_encoder::SolValue::abi_encode(&cctp_transfer_cfg).into(),
194194
)
195195
.into_transaction_request()
196196
.from(admin);
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
[noble]
2-
grpc_url = "http://0.0.0.0"
2+
grpc_url = "http://0.0.0.0"
33
grpc_port = "63731"
4-
chain_id = "localnoble-1"
5-
mnemonic = "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
4+
chain_id = "localnoble-1"
5+
mnemonic = "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
66

77
[neutron]
8-
grpc_url = "http://0.0.0.0"
9-
grpc_port = "64749"
10-
chain_id = "localneutron-1"
11-
mnemonic = "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
8+
grpc_url = "http://0.0.0.0"
9+
grpc_port = "64749"
10+
chain_id = "localneutron-1"
11+
mnemonic = "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
1212
target_pool = "neutron19wfdqvt2rfhffpl0unulepjuwcgf0ycz3fu448u2v6f45j2c7fvq5fgvyy"
1313

1414
[neutron.denoms]
1515
lp_token = "factory/neutron19wfdqvt2rfhffpl0unulepjuwcgf0ycz3fu448u2v6f45j2c7fvq5fgvyy/astroport/share"
16-
usdc = "ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349"
17-
ntrn = "untrn"
16+
usdc = "ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349"
17+
ntrn = "untrn"
1818

1919
[neutron.accounts]
20-
deposit = "neutron1qljtk4khhd5242t49yqapysv63uzue70jq0pavwjct36xs98gu4s7xqzed"
21-
position = "neutron1kgn0k6aqakdp52at7ypdc9cpl0megm9gw3pkcmdpl6g5jyl45m5qu76p2z"
22-
withdraw = "neutron1tt4tzqz0kamjnraxwkdzw62z8yzzqheqnkrzxlh52xul5k96jrjqja3dta"
20+
deposit = "neutron1qljtk4khhd5242t49yqapysv63uzue70jq0pavwjct36xs98gu4s7xqzed"
21+
position = "neutron1kgn0k6aqakdp52at7ypdc9cpl0megm9gw3pkcmdpl6g5jyl45m5qu76p2z"
22+
withdraw = "neutron1tt4tzqz0kamjnraxwkdzw62z8yzzqheqnkrzxlh52xul5k96jrjqja3dta"
2323
liquidation = "neutron10l0ltapgnd746a6rgty5vkd33tex54ddvf2eyu3qas0050q7yehsumh7j2"
2424

2525
[neutron.accounts.noble_inbound_ica]
2626
library_account = "neutron16xz4vg9xh9arxfky5zwl8g6mtk9dxkjt7h608f80dplkfzgr3mesv9qtdh"
27-
remote_addr = "noble1d8rra6k4t6chcnv3s7v0u555yn8gqhvsj2qhcvrugaf2w4frrezqjjke0a"
27+
remote_addr = "noble1d8rra6k4t6chcnv3s7v0u555yn8gqhvsj2qhcvrugaf2w4frrezqjjke0a"
2828

2929
[neutron.accounts.noble_outbound_ica]
3030
library_account = "neutron1uaf28tgvtgjd40nw2wv9ckwmcwad7eeca6y3pvcral53as9tkqxq6nywha"
31-
remote_addr = "noble12ugxxvxcqu3lrfnunwxgsc8w3hpu7fcf4gf0790kdnh4fvlgu70qjk6gjn"
31+
remote_addr = "noble12ugxxvxcqu3lrfnunwxgsc8w3hpu7fcf4gf0790kdnh4fvlgu70qjk6gjn"
3232

3333
[neutron.libraries]
34-
neutron_ibc_transfer = "neutron1juque0va5ya8tcvrxu2kq3s4gdfrzw2yv6k7glr7z0uu563qze4s2knnt4"
34+
neutron_ibc_transfer = "neutron1juque0va5ya8tcvrxu2kq3s4gdfrzw2yv6k7glr7z0uu563qze4s2knnt4"
3535
noble_inbound_transfer = "neutron14wzrxt6u557ecr98w2z22ygnu77w34uqfel72k8t8xatneajy2xq9rvs87"
36-
noble_cctp_transfer = "neutron1j30wx6kjfsessdx5mlp32hqwklj48ufvtve50ymzg7dc6870sw3s42j44h"
37-
astroport_lper = "neutron1nycr84qcjk8wdwwlnexf40ctu46n3xzrxmkwaydsaw42sxny0vtsvcuca2"
38-
astroport_lwer = "neutron1lqgdq9u8zhcvwwwz3xjswactrtq6qzptmlzlh6xspl34dxq32uhq44hq5v"
39-
liquidation_forwarder = "neutron1mx32w9tnfxv0z5j000750h8ver7qf3xpj09w3uzvsr3hq68f4hxqwg06ta"
40-
authorizations = "neutron1r54uexfzu58yksg7eyegyrmcc829v9xtgpauz370npe87k7g5gwsts76vu"
41-
processor = "neutron1cyd63pk2wuvjkqmhlvp9884z4h89rqtn8w8xgz9m28hjd2kzj2cqt9gc49"
36+
noble_cctp_transfer = "neutron1j30wx6kjfsessdx5mlp32hqwklj48ufvtve50ymzg7dc6870sw3s42j44h"
37+
astroport_lper = "neutron1nycr84qcjk8wdwwlnexf40ctu46n3xzrxmkwaydsaw42sxny0vtsvcuca2"
38+
astroport_lwer = "neutron1lqgdq9u8zhcvwwwz3xjswactrtq6qzptmlzlh6xspl34dxq32uhq44hq5v"
39+
liquidation_forwarder = "neutron1mx32w9tnfxv0z5j000750h8ver7qf3xpj09w3uzvsr3hq68f4hxqwg06ta"
40+
authorizations = "neutron1r54uexfzu58yksg7eyegyrmcc829v9xtgpauz370npe87k7g5gwsts76vu"
41+
processor = "neutron1cyd63pk2wuvjkqmhlvp9884z4h89rqtn8w8xgz9m28hjd2kzj2cqt9gc49"
4242

4343
[ethereum]
44-
rpc_url = "http://localhost:8545"
44+
rpc_url = "http://localhost:8545"
4545
mnemonic = "test test test test test test test test test test test junk"
4646

4747
[ethereum.denoms]
4848
usdc_erc20 = "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"
4949

5050
[ethereum.accounts]
51-
deposit = "0x5FbDB2315678afecb367f032d93F642f64180aa3"
51+
deposit = "0x5FbDB2315678afecb367f032d93F642f64180aa3"
5252
withdraw = "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
5353

5454
[ethereum.libraries]
55-
valence_vault = "0x9A676e781A523b5d0C0e43731313A708CB607508"
55+
valence_vault = "0x9A676e781A523b5d0C0e43731313A708CB607508"
5656
cctp_forwarder = "0x610178dA211FEF7D417bC0e6FeD39F05609AD788"
5757
lite_processor = "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0"

0 commit comments

Comments
 (0)