dsa-connectors/scripts/tests/arbitrum/tokens.ts

54 lines
1.5 KiB
TypeScript
Raw Permalink Normal View History

2022-05-14 17:13:14 +00:00
import { Provider } from "@ethersproject/abstract-provider";
import { Signer } from "@ethersproject/abstract-signer";
import { ethers } from "hardhat";
const mineTx = async (tx: any) => {
await (await tx).wait();
};
2021-12-10 19:10:45 +00:00
export const tokens = {
eth: {
type: "token",
symbol: "ETH",
name: "Ethereum",
address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
2022-05-14 17:13:14 +00:00
decimals: 18
2021-12-10 19:10:45 +00:00
},
dai: {
type: "token",
symbol: "DAI",
name: "DAI Stable",
address: "0xd586e7f844cea2f87f50152665bcbc2c279d8d70",
2022-05-14 17:13:14 +00:00
decimals: 18
2021-12-10 19:10:45 +00:00
},
usdc: {
type: "token",
symbol: "USDC",
name: "USD Coin",
address: "0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664",
2022-05-14 17:13:14 +00:00
decimals: 6
}
};
export const tokenMapping: Record<string, any> = {
usdc: {
impersonateSigner: "0xce2cc46682e9c6d5f174af598fb4931a9c0be68e",
address: "0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664",
abi: ["function mint(address _to, uint256 _amount) external returns (bool);"],
process: async function (owner: Signer | Provider, to: any, amt: any) {
const contract = new ethers.Contract(this.address, this.abi, owner);
await mineTx(contract.mint(to, amt));
}
2021-12-10 19:10:45 +00:00
},
2022-05-14 17:13:14 +00:00
dai: {
impersonateSigner: "0xc5ed2333f8a2c351fca35e5ebadb2a82f5d254c3",
abi: ["function transfer(address to, uint value)"],
address: "0xd586e7f844cea2f87f50152665bcbc2c279d8d70",
process: async function (owner: Signer | Provider, to: any, amt: any) {
const contract = new ethers.Contract(this.address, this.abi, owner);
await mineTx(contract.transfer(to, amt));
}
}
2021-12-10 19:10:45 +00:00
};