This repository has been archived by the owner on Mar 22, 2023. It is now read-only.
forked from Uniswap/v2-subgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
keys successfully removed and added to .gitignore
now, to do deployment first create keys, fund them then add them to scripts ERC20, FACTORY, PAIR and ROUTER folders etherwise runn scripts command would throw errors. See all script commands from readme
- Loading branch information
1 parent
a7f84f5
commit 84053c6
Showing
66 changed files
with
700 additions
and
1,325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/node_modules | ||
# /JsClients/ERC20/keys | ||
# /JsClients/FACTORY/keys | ||
# /JsClients/PAIR/keys | ||
# /JsClients/ROUTER/keys | ||
/Scripts/ERC20/keys | ||
/Scripts/FACTORY/keys | ||
/Scripts/PAIR/keys | ||
/Scripts/ROUTER/keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import { config } from "dotenv"; | ||
config(); | ||
import { ERC20Client} from "../src"; | ||
|
||
const { | ||
NODE_ADDRESS, | ||
EVENT_STREAM_ADDRESS, | ||
CHAIN_NAME | ||
} = process.env; | ||
|
||
const erc20 = new ERC20Client( | ||
NODE_ADDRESS!, | ||
CHAIN_NAME!, | ||
EVENT_STREAM_ADDRESS! | ||
); | ||
|
||
export const getName = async (contractHash:string) => { | ||
|
||
// We don't need hash- prefix so i'm removing it | ||
await erc20.setContractHash(contractHash); | ||
|
||
//name | ||
const name = await erc20.name(); | ||
console.log(contractHash +` =... Contract name: ${name}`); | ||
|
||
return name; | ||
|
||
}; | ||
|
||
export const getSymbol = async (contractHash:string) => { | ||
|
||
// We don't need hash- prefix so i'm removing it | ||
await erc20.setContractHash(contractHash); | ||
|
||
//symbol | ||
const symbol = await erc20.symbol(); | ||
console.log(contractHash +` =... Contract symbol: ${symbol}`); | ||
|
||
return symbol; | ||
|
||
}; | ||
|
||
export const getDecimals = async (contractHash:string) => { | ||
|
||
// We don't need hash- prefix so i'm removing it | ||
await erc20.setContractHash(contractHash); | ||
|
||
//decimal | ||
const decimal = await erc20.decimal(); | ||
console.log(contractHash +" =... Contract decimal: ", decimal); | ||
|
||
return decimal; | ||
|
||
}; | ||
|
||
export const getTotalSupply = async (contractHash:string) => { | ||
|
||
// We don't need hash- prefix so i'm removing it | ||
await erc20.setContractHash(contractHash); | ||
|
||
//totalsupply | ||
let totalSupply = await erc20.totalSupply(); | ||
console.log(contractHash +` = ... Total supply: ${totalSupply}`); | ||
|
||
return totalSupply; | ||
|
||
}; | ||
|
||
export const balanceOf = async (contractHash:string, key:string) => { | ||
|
||
console.log(`... Contract Hash: ${contractHash}`); | ||
|
||
// We don't need hash- prefix so i'm removing it | ||
await erc20.setContractHash(contractHash); | ||
|
||
//balanceof | ||
let balance = await erc20.balanceOf(key); | ||
|
||
console.log(`... Balance: ${balance}`); | ||
|
||
return balance; | ||
|
||
}; | ||
|
||
export const allowance = async (contractHash:string, ownerkey:string, spenderkey:string) => { | ||
|
||
console.log(`... Contract Hash: ${contractHash}`); | ||
|
||
// We don't need hash- prefix so i'm removing it | ||
await erc20.setContractHash(contractHash); | ||
|
||
let allowance = await erc20.allowance(ownerkey,spenderkey); | ||
|
||
console.log(`... Allowance: ${allowance}`); | ||
|
||
return allowance; | ||
|
||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.