-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinteract.ts
76 lines (60 loc) · 1.92 KB
/
interact.ts
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
import { Contract, Wallet, JsonRpcProvider } from "ethers";
import fiatTokenV2_2 from "./artifacts/foundry/FiatTokenV2_2.sol/FiatTokenV2_2.json";
import * as dotenv from "dotenv";
// const approve_spend = "100000";
// const minter_allow = "1000000000000000000000000";
// const decimals = 6;
async function main() {
dotenv.config();
const contractAddress = "0x5eC7Bde74D2a820b932045a407EF3FF5CA7c7a5d";
const rpc = await new JsonRpcProvider(process.env.RPC_ENDPOINT, {
name: "Radius Testnet",
chainId: 1223953,
});
const wallet = new Wallet(
"a597b4f2bdb5f30995f948af8c0fbd2665a89ecf44e5839dbef83665df070c78",
rpc
);
const fiatTokenProxyContract = new Contract(
contractAddress,
fiatTokenV2_2.abi,
wallet
);
await fiatTokenProxyContract.name().then((value) => {
console.log("Token name: %s", value);
});
await fiatTokenProxyContract.symbol().then((value) => {
console.log("Total Supply: %s", value);
});
await fiatTokenProxyContract.totalSupply().then((value) => {
console.log("Total Supply: %s", value);
});
await fiatTokenProxyContract.decimals().then((value) => {
console.log("Decimals : %s", value);
});
await fiatTokenProxyContract.version().then((value) => {
console.log("Version: %s", value);
});
await fiatTokenProxyContract
.balanceOf("0xAbd7D078f8CB73Efd9E6ba684D871F51Da88c7cB")
.then((value) => {
console.log(
"0xAbd7D078f8CB73Efd9E6ba684D871F51Da88c7cB Radius USDC Balance: %s",
value
);
});
await fiatTokenProxyContract.masterMinter().then((value) => {
console.log("Master Minter: %s ", value);
});
await fiatTokenProxyContract
.balanceOf("0x0320c72946E46E2bbb2d8700982e87c6f2c3503D")
.then((value) => {
console.log("Balance Of Radius Bridge Contract is: %s ", value);
});
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});