This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,452 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Local: Ganache-cli | ||
NODE_URL=ws://localhost:8545 | ||
STABLE_COIN_CONTRACT_ADDRESS=0x855d1c79Ad3fb086D516554Dc7187E3Fdfc1C79a | ||
|
||
# Rinkeby | ||
#NODE_URL=https://rinkeby.infura.io/v3/<your-api-key> | ||
#STABLE_COIN_CONTRACT_ADDRESS=0x9046451F7cF124c1d7d1832F76F5e98a33D1610E | ||
|
||
# Production | ||
#NODE_URL=https://mainnet.infura.io/v3/<your-api-key> | ||
#STABLE_COIN_CONTRACT_ADDRESS=<not-deployed-yet> | ||
|
||
# WEB: Front end. It can be any instance of this web https://github.com/gnosis/dex-react | ||
WEB_BASE_URL=https://dex-react | ||
|
||
NODE_URL=http://localhost:8545 |
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 |
---|---|---|
@@ -0,0 +1,225 @@ | ||
import { AbiItem } from 'web3-utils' | ||
|
||
const Erc20Abi: AbiItem[] = [ | ||
{ | ||
constant: true, | ||
inputs: [], | ||
name: 'name', | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'string' | ||
} | ||
], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function' | ||
}, | ||
{ | ||
constant: false, | ||
inputs: [ | ||
{ | ||
name: '_spender', | ||
type: 'address' | ||
}, | ||
{ | ||
name: '_value', | ||
type: 'uint256' | ||
} | ||
], | ||
name: 'approve', | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'bool' | ||
} | ||
], | ||
payable: false, | ||
stateMutability: 'nonpayable', | ||
type: 'function' | ||
}, | ||
{ | ||
constant: true, | ||
inputs: [], | ||
name: 'totalSupply', | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'uint256' | ||
} | ||
], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function' | ||
}, | ||
{ | ||
constant: false, | ||
inputs: [ | ||
{ | ||
name: '_from', | ||
type: 'address' | ||
}, | ||
{ | ||
name: '_to', | ||
type: 'address' | ||
}, | ||
{ | ||
name: '_value', | ||
type: 'uint256' | ||
} | ||
], | ||
name: 'transferFrom', | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'bool' | ||
} | ||
], | ||
payable: false, | ||
stateMutability: 'nonpayable', | ||
type: 'function' | ||
}, | ||
{ | ||
constant: true, | ||
inputs: [], | ||
name: 'decimals', | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'uint8' | ||
} | ||
], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function' | ||
}, | ||
{ | ||
constant: true, | ||
inputs: [ | ||
{ | ||
name: '_owner', | ||
type: 'address' | ||
} | ||
], | ||
name: 'balanceOf', | ||
outputs: [ | ||
{ | ||
name: 'balance', | ||
type: 'uint256' | ||
} | ||
], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function' | ||
}, | ||
{ | ||
constant: true, | ||
inputs: [], | ||
name: 'symbol', | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'string' | ||
} | ||
], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function' | ||
}, | ||
{ | ||
constant: false, | ||
inputs: [ | ||
{ | ||
name: '_to', | ||
type: 'address' | ||
}, | ||
{ | ||
name: '_value', | ||
type: 'uint256' | ||
} | ||
], | ||
name: 'transfer', | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'bool' | ||
} | ||
], | ||
payable: false, | ||
stateMutability: 'nonpayable', | ||
type: 'function' | ||
}, | ||
{ | ||
constant: true, | ||
inputs: [ | ||
{ | ||
name: '_owner', | ||
type: 'address' | ||
}, | ||
{ | ||
name: '_spender', | ||
type: 'address' | ||
} | ||
], | ||
name: 'allowance', | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'uint256' | ||
} | ||
], | ||
payable: false, | ||
stateMutability: 'view', | ||
type: 'function' | ||
}, | ||
{ | ||
payable: true, | ||
stateMutability: 'payable', | ||
type: 'fallback' | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ | ||
indexed: true, | ||
name: 'owner', | ||
type: 'address' | ||
}, | ||
{ | ||
indexed: true, | ||
name: 'spender', | ||
type: 'address' | ||
}, | ||
{ | ||
indexed: false, | ||
name: 'value', | ||
type: 'uint256' | ||
} | ||
], | ||
name: 'Approval', | ||
type: 'event' | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ | ||
indexed: true, | ||
name: 'from', | ||
type: 'address' | ||
}, | ||
{ | ||
indexed: true, | ||
name: 'to', | ||
type: 'address' | ||
}, | ||
{ | ||
indexed: false, | ||
name: 'value', | ||
type: 'uint256' | ||
} | ||
], | ||
name: 'Transfer', | ||
type: 'event' | ||
} | ||
] | ||
export default Erc20Abi |
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,29 @@ | ||
import BN from 'bn.js' | ||
|
||
import { TransactionObject } from 'contracts/types' | ||
import { Contract } from 'web3-eth-contract' | ||
|
||
export interface Erc20Contract extends Contract { | ||
clone(): Erc20Contract | ||
|
||
methods: { | ||
totalSupply(): TransactionObject<string> | ||
decimals(): TransactionObject<string> | ||
symbol(): TransactionObject<string> | ||
name(): TransactionObject<string> | ||
|
||
balanceOf(owner: string): TransactionObject<string, [string]> | ||
|
||
allowance(owner: string, spender: string): TransactionObject<string, [string, string]> | ||
|
||
approve(spender: string, value: number | string | BN): TransactionObject<boolean, [string, string | number | BN]> | ||
|
||
transfer(to: string, value: number | string | BN): TransactionObject<boolean, [string, string | number | BN]> | ||
|
||
transferFrom( | ||
from: string, | ||
to: string, | ||
value: number | string | BN, | ||
): TransactionObject<boolean, [string, string, string | number | BN]> | ||
} | ||
} |
Oops, something went wrong.