@parity/light.js
Version:
A high-level reactive JS library optimized for light clients
156 lines (153 loc) • 3.6 kB
JavaScript
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
// SPDX-License-Identifier: MIT
/**
* Get the GavCoin contract address for different chains
*/
export const gavCoinAddress = chainName => {
switch (chainName) {
case 'kovan':
return '0x4733659a5cB7896A65c918Add6f59C5148FB5ffa';
case 'foundation':
default:
return '0x0b8D56c26D8CF16FE1BdDf4967753503d974DE06';
}
};
export const gavCoinAbi = [
{
constant: false,
inputs: [
{ name: '_spender', type: 'address' },
{ name: '_value', type: 'uint256' }
],
name: 'approve',
outputs: [{ name: 'success', type: 'bool' }],
type: 'function'
},
{
constant: true,
inputs: [],
name: 'totalSupply',
outputs: [{ name: '', type: 'uint256' }],
type: 'function'
},
{
constant: false,
inputs: [
{ name: '_from', type: 'address' },
{ name: '_to', type: 'address' },
{ name: '_value', type: 'uint256' }
],
name: 'transferFrom',
outputs: [{ name: 'success', type: 'bool' }],
type: 'function'
},
{
constant: false,
inputs: [
{ name: '_who', type: 'address' },
{ name: '_maxPrice', type: 'uint256' }
],
name: 'buyin',
outputs: [],
type: 'function'
},
{
constant: true,
inputs: [],
name: 'remaining',
outputs: [{ name: '', type: 'uint256' }],
type: 'function'
},
{
constant: false,
inputs: [
{ name: '_price', type: 'uint256' },
{ name: '_units', type: 'uint256' }
],
name: 'refund',
outputs: [{ name: '', type: 'bool' }],
type: 'function'
},
{
constant: true,
inputs: [{ name: '_who', type: 'address' }],
name: 'balanceOf',
outputs: [{ name: '', type: 'uint256' }],
type: 'function'
},
{
constant: true,
inputs: [],
name: 'price',
outputs: [{ name: '', type: 'uint256' }],
type: 'function'
},
{
constant: false,
inputs: [
{ name: '_to', type: 'address' },
{ name: '_value', type: 'uint256' }
],
name: 'transfer',
outputs: [{ name: 'success', type: 'bool' }],
type: 'function'
},
{
constant: true,
inputs: [
{ name: '_owner', type: 'address' },
{ name: '_spender', type: 'address' }
],
name: 'allowance',
outputs: [{ name: 'remaining', type: 'uint256' }],
type: 'function'
},
{
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'
},
{
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: 'buyer', type: 'address' },
{ indexed: true, name: 'price', type: 'uint256' },
{ indexed: true, name: 'amount', type: 'uint256' }
],
name: 'Buyin',
type: 'event'
},
{
anonymous: false,
inputs: [
{ indexed: true, name: 'buyer', type: 'address' },
{ indexed: true, name: 'price', type: 'uint256' },
{ indexed: true, name: 'amount', type: 'uint256' }
],
name: 'Refund',
type: 'event'
},
{
anonymous: false,
inputs: [{ indexed: true, name: 'price', type: 'uint256' }],
name: 'NewTranch',
type: 'event'
}
];