Skip to content

Commit 832c01e

Browse files
committed
Add Ethereum code, rename auctioneer-sdk, add ERC20 ABI
1 parent 1f998f3 commit 832c01e

File tree

10 files changed

+359
-24
lines changed

10 files changed

+359
-24
lines changed

Cargo.lock

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
exclude = []
3-
members = ["mantis-sdk", "mantis-cli", "auctioneer-sdk"]
3+
members = ["mantis-sdk", "mantis-cli", "auction-sdk"]
44
resolver = "2"
55

66
[workspace.package]
@@ -30,7 +30,10 @@ spl-token-2022 = { version = "7.0.0", features = ["no-entrypoint"] }
3030
alloy = { version = "0.9.2", features = ["full", "node-bindings", "signer-mnemonic"] }
3131
anyhow = "1.0.96"
3232
base64 = "0.22.1"
33+
chrono = "0.4.40"
3334
clap = { version = "4.5.32", features = ["derive"] }
3435
num = "0.4.3"
3536
rand = "0.8.0"
3637
tokio = { version = "1.43.0", features = ["full"] }
38+
39+
mantis-sdk = { path = "mantis-sdk" }

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
# Mantis SDK 🦀
2-
3-
A Rust SDK library to interact with the Mantis smart contracts.
4-
51
# Mantis CLI 🦀
62

73
A CLI utility to interact with the Mantis smart contracts.
84

9-
# Auctioneer SDK 🦀
5+
```sh
6+
cargo install --path=mantis-cli
7+
```
8+
9+
To perform a swap from USDC to USDT on Solana with 5 min timeout:
10+
11+
```sh
12+
mantis-cli swap --src_chain=solana --dst_chain=solana --token_in=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --token_out=Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB --amount_in=10000000 --amount_out=1 --timeout=300
13+
```
14+
15+
# Mantis SDK 🦀
16+
17+
A Rust SDK library to interact with the Mantis smart contracts.
18+
19+
# Auction SDK 🦀
1020

1121
A Rust SDK library for solvers to integrate with the auction process.
1222

13-
# Mantis SDK 🟦
23+
# Mantis SDK TS 🟦
1424

1525
A TypeScript SDK library to interact with the Mantis smart contracts.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[package]
2-
name = "auctioneer-sdk"
3-
version = "0.0.0"
42
edition = "2021"
3+
name = "auction-sdk"
4+
version = "0.0.0"
55

66
[lib]
7+
name = "auction_sdk"
78
path = "src/lib.rs"
8-
name = "auctioneer_sdk"
99

1010
[dependencies]
File renamed without changes.

mantis-cli/Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "mantis-cli"
3-
version = "0.0.0"
42
edition = "2021"
3+
name = "mantis-cli"
4+
version = "0.1.0"
55

66
[[bin]]
7-
path = "src/main.rs"
87
name = "mantis-cli"
8+
path = "src/main.rs"
99

1010
[dependencies]
1111
anchor-client = { workspace = true }
@@ -29,3 +29,5 @@ base64 = { workspace = true }
2929
num = { workspace = true }
3030
rand = { workspace = true }
3131
tokio = { workspace = true }
32+
33+
mantis-sdk = { workspace = true }

mantis-sdk/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "mantis-sdk"
3-
version = "0.0.0"
42
edition = "2021"
3+
name = "mantis-sdk"
4+
version = "0.1.0"
55

66
[lib]
7-
path = "src/lib.rs"
87
name = "mantis_sdk"
8+
path = "src/lib.rs"
99

1010
[dependencies]
1111
anchor-client = { workspace = true }
@@ -26,6 +26,7 @@ spl-token-2022 = { workspace = true }
2626
alloy = { workspace = true }
2727
anyhow = { workspace = true }
2828
base64 = { workspace = true }
29+
chrono = { workspace = true }
2930
num = { workspace = true }
3031
rand = { workspace = true }
3132
tokio = { workspace = true }

mantis-sdk/abis/erc20.json

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
[
2+
{
3+
"type": "function",
4+
"name": "allowance",
5+
"inputs": [
6+
{
7+
"name": "owner",
8+
"type": "address",
9+
"internalType": "address"
10+
},
11+
{
12+
"name": "spender",
13+
"type": "address",
14+
"internalType": "address"
15+
}
16+
],
17+
"outputs": [
18+
{
19+
"name": "",
20+
"type": "uint256",
21+
"internalType": "uint256"
22+
}
23+
],
24+
"stateMutability": "view"
25+
},
26+
{
27+
"type": "function",
28+
"name": "approve",
29+
"inputs": [
30+
{
31+
"name": "spender",
32+
"type": "address",
33+
"internalType": "address"
34+
},
35+
{
36+
"name": "amount",
37+
"type": "uint256",
38+
"internalType": "uint256"
39+
}
40+
],
41+
"outputs": [
42+
{
43+
"name": "",
44+
"type": "bool",
45+
"internalType": "bool"
46+
}
47+
],
48+
"stateMutability": "nonpayable"
49+
},
50+
{
51+
"type": "function",
52+
"name": "balanceOf",
53+
"inputs": [
54+
{
55+
"name": "account",
56+
"type": "address",
57+
"internalType": "address"
58+
}
59+
],
60+
"outputs": [
61+
{
62+
"name": "",
63+
"type": "uint256",
64+
"internalType": "uint256"
65+
}
66+
],
67+
"stateMutability": "view"
68+
},
69+
{
70+
"type": "function",
71+
"name": "decimals",
72+
"inputs": [],
73+
"outputs": [
74+
{
75+
"name": "",
76+
"type": "uint8",
77+
"internalType": "uint8"
78+
}
79+
],
80+
"stateMutability": "view"
81+
},
82+
{
83+
"type": "function",
84+
"name": "name",
85+
"inputs": [],
86+
"outputs": [
87+
{
88+
"name": "",
89+
"type": "string",
90+
"internalType": "string"
91+
}
92+
],
93+
"stateMutability": "view"
94+
},
95+
{
96+
"type": "function",
97+
"name": "symbol",
98+
"inputs": [],
99+
"outputs": [
100+
{
101+
"name": "",
102+
"type": "string",
103+
"internalType": "string"
104+
}
105+
],
106+
"stateMutability": "view"
107+
},
108+
{
109+
"type": "function",
110+
"name": "totalSupply",
111+
"inputs": [],
112+
"outputs": [
113+
{
114+
"name": "",
115+
"type": "uint256",
116+
"internalType": "uint256"
117+
}
118+
],
119+
"stateMutability": "view"
120+
},
121+
{
122+
"type": "function",
123+
"name": "transfer",
124+
"inputs": [
125+
{
126+
"name": "to",
127+
"type": "address",
128+
"internalType": "address"
129+
},
130+
{
131+
"name": "amount",
132+
"type": "uint256",
133+
"internalType": "uint256"
134+
}
135+
],
136+
"outputs": [
137+
{
138+
"name": "",
139+
"type": "bool",
140+
"internalType": "bool"
141+
}
142+
],
143+
"stateMutability": "nonpayable"
144+
},
145+
{
146+
"type": "function",
147+
"name": "transferFrom",
148+
"inputs": [
149+
{
150+
"name": "from",
151+
"type": "address",
152+
"internalType": "address"
153+
},
154+
{
155+
"name": "to",
156+
"type": "address",
157+
"internalType": "address"
158+
},
159+
{
160+
"name": "amount",
161+
"type": "uint256",
162+
"internalType": "uint256"
163+
}
164+
],
165+
"outputs": [
166+
{
167+
"name": "",
168+
"type": "bool",
169+
"internalType": "bool"
170+
}
171+
],
172+
"stateMutability": "nonpayable"
173+
},
174+
{
175+
"type": "event",
176+
"name": "Approval",
177+
"inputs": [
178+
{
179+
"name": "owner",
180+
"type": "address",
181+
"indexed": true,
182+
"internalType": "address"
183+
},
184+
{
185+
"name": "spender",
186+
"type": "address",
187+
"indexed": true,
188+
"internalType": "address"
189+
},
190+
{
191+
"name": "value",
192+
"type": "uint256",
193+
"indexed": false,
194+
"internalType": "uint256"
195+
}
196+
],
197+
"anonymous": false
198+
},
199+
{
200+
"type": "event",
201+
"name": "Transfer",
202+
"inputs": [
203+
{
204+
"name": "from",
205+
"type": "address",
206+
"indexed": true,
207+
"internalType": "address"
208+
},
209+
{
210+
"name": "to",
211+
"type": "address",
212+
"indexed": true,
213+
"internalType": "address"
214+
},
215+
{
216+
"name": "value",
217+
"type": "uint256",
218+
"indexed": false,
219+
"internalType": "uint256"
220+
}
221+
],
222+
"anonymous": false
223+
}
224+
]

0 commit comments

Comments
 (0)