Skip to content

Commit 0273a08

Browse files
📝 Update readme
1 parent 086b31d commit 0273a08

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

README.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
# AVNU Contracts
22

3-
This repository contains the contracts used by [AVNU](https://www.avnu.fi/). You can test them by using our [testnet](https://app.avnu.fi/).
3+
This repository contains the contracts used by [AVNU](https://www.avnu.fi/).
44

5-
If you want to learn more about AVNU, and how we are able to provide the best execution on Starknet, you can visit our [documentation](https://doc.avnu.fi/).
5+
If you want to learn more about AVNU, and how we are able to provide the best execution on Starknet, you can visit
6+
our [documentation](https://doc.avnu.fi/).
67

78
## Structure
89

910
- **Exchange**: Handles the swap. It contains all the routing logic
1011

11-
AVNUExchange uses **Adapter**s to call each AMM.
12+
AVNUExchange uses **Adapter**s to call each AMM.
1213
These adapters are declared on Starknet and then called using library calls.
1314
A mapping of "AMM Router address" to "Adapter class hash" is stored inside the AVNUExchange contract.
1415

16+
| Mainnet | Sepolia |
17+
|--------------------------------------------------------------------|--------------------------------------------------------------------|
18+
| 0x04270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f | 0x02c56e8b00dbe2a71e57472685378fc8988bba947e9a99b26a00fade2b4fe7c2 |
19+
1520
## Exchange contract
1621

17-
Here is the interface of the contract:
22+
Here is the interface of the contract:
1823

1924
```cairo
2025
#[starknet::interface]
2126
trait IExchange<TContractState> {
2227
fn get_owner(self: @TContractState) -> ContractAddress;
2328
fn transfer_ownership(ref self: TContractState, new_owner: ContractAddress) -> bool;
2429
fn upgrade_class(ref self: TContractState, new_class_hash: ClassHash) -> bool;
25-
fn get_adapter_class_hash(
26-
self: @TContractState, exchange_address: ContractAddress
27-
) -> ClassHash;
28-
fn set_adapter_class_hash(
29-
ref self: TContractState, exchange_address: ContractAddress, adapter_class_hash: ClassHash
30-
) -> bool;
30+
fn get_adapter_class_hash(self: @TContractState, exchange_address: ContractAddress) -> ClassHash;
31+
fn set_adapter_class_hash(ref self: TContractState, exchange_address: ContractAddress, adapter_class_hash: ClassHash) -> bool;
3132
fn get_fees_active(self: @TContractState) -> bool;
3233
fn set_fees_active(ref self: TContractState, active: bool) -> bool;
3334
fn get_fees_recipient(self: @TContractState) -> ContractAddress;
@@ -36,6 +37,8 @@ trait IExchange<TContractState> {
3637
fn set_fees_bps_0(ref self: TContractState, bps: u128) -> bool;
3738
fn get_fees_bps_1(self: @TContractState) -> u128;
3839
fn set_fees_bps_1(ref self: TContractState, bps: u128) -> bool;
40+
fn get_swap_exact_token_to_fees_bps(self: @TContractState) -> u128;
41+
fn set_swap_exact_token_to_fees_bps(ref self: TContractState, bps: u128) -> bool;
3942
fn multi_route_swap(
4043
ref self: TContractState,
4144
token_from_address: ContractAddress,
@@ -48,6 +51,16 @@ trait IExchange<TContractState> {
4851
integrator_fee_recipient: ContractAddress,
4952
routes: Array<Route>,
5053
) -> bool;
54+
fn swap_exact_token_to(
55+
ref self: TContractState,
56+
token_from_address: ContractAddress,
57+
token_from_amount: u256,
58+
token_from_max_amount: u256,
59+
token_to_address: ContractAddress,
60+
token_to_amount: u256,
61+
beneficiary: ContractAddress,
62+
routes: Array<Route>,
63+
) -> bool;
5164
}
5265
```
5366

0 commit comments

Comments
 (0)