Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
feat: Add support for tokens BNTY and MKR (#4)
Browse files Browse the repository at this point in the history
* add artifact for BNTY and MKR

* add BNTY and MKR in library

* update burner address in truffle deploy

* add BNTY and MKR in the smartcontract readme
  • Loading branch information
vrolland committed Apr 25, 2019
1 parent 8a05fce commit c64cd41
Show file tree
Hide file tree
Showing 7 changed files with 700 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/requestNetwork.js/src/types.ts
Expand Up @@ -26,6 +26,8 @@ export enum Currency {
BAT,
BNB,
LINK,
BNTY,
MKR,
}

// State of the Request
Expand Down
16 changes: 16 additions & 0 deletions packages/requestNetwork.js/src/utils/currency.ts
Expand Up @@ -96,6 +96,20 @@ function getCurrencyConfig(currency: Types.Currency)
service: RequestERC20Service.getInstance(),
decimals: 18,
},
[Types.Currency.BNTY as number]: {
erc20TokenAddresses: {
main: '0xd2d6158683aee4cc838067727209a0aaf4359de3',
},
service: RequestERC20Service.getInstance(),
decimals: 18,
},
[Types.Currency.MKR as number]: {
erc20TokenAddresses: {
main: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2',
},
service: RequestERC20Service.getInstance(),
decimals: 18,
},
}[currency];

if (!currencyConfig) {
Expand Down Expand Up @@ -146,6 +160,8 @@ export default {
'RequestERC20-bat': Types.Currency.BAT,
'RequestERC20-bnb': Types.Currency.BNB,
'RequestERC20-link': Types.Currency.LINK,
'RequestERC20-bnty': Types.Currency.BNTY,
'RequestERC20-mkr': Types.Currency.MKR,
};

const currencyContractName = requestArtifacts.getContractNameForAddress(address.toLowerCase());
Expand Down
@@ -0,0 +1,337 @@
{
"contractName": "RequestERC20",
"abi": [
{
"constant": true,
"inputs": [{ "name": "_expectedAmount", "type": "int256" }],
"name": "collectEstimation",
"outputs": [{ "name": "", "type": "uint256" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "rateFeesNumerator",
"outputs": [{ "name": "", "type": "uint256" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "name": "_requestId", "type": "bytes32" },
{ "name": "_payeeAmounts", "type": "uint256[]" },
{ "name": "_additionalAmounts", "type": "uint256[]" }
],
"name": "paymentAction",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "name": "_requestId", "type": "bytes32" },
{ "name": "_subtractAmounts", "type": "uint256[]" }
],
"name": "subtractAction",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "unpause",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "name": "_requestData", "type": "bytes" },
{ "name": "_payeesPaymentAddress", "type": "address[]" },
{ "name": "_payeeAmounts", "type": "uint256[]" },
{ "name": "_additionals", "type": "uint256[]" },
{ "name": "_expirationDate", "type": "uint256" },
{ "name": "_signature", "type": "bytes" }
],
"name": "broadcastSignedRequestAsPayerAction",
"outputs": [{ "name": "requestId", "type": "bytes32" }],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [{ "name": "_requestBurnerContract", "type": "address" }],
"name": "setRequestBurnerContract",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "paused",
"outputs": [{ "name": "", "type": "bool" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "name": "_payeesIdAddress", "type": "address[]" },
{ "name": "_payeesPaymentAddress", "type": "address[]" },
{ "name": "_expectedAmounts", "type": "int256[]" },
{ "name": "_payer", "type": "address" },
{ "name": "_payerRefundAddress", "type": "address" },
{ "name": "_data", "type": "string" }
],
"name": "createRequestAsPayeeAction",
"outputs": [{ "name": "requestId", "type": "bytes32" }],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "requestCore",
"outputs": [{ "name": "", "type": "address" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "rateFeesDenominator",
"outputs": [{ "name": "", "type": "uint256" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [{ "name": "_requestId", "type": "bytes32" }],
"name": "cancelAction",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "name": "_requestId", "type": "bytes32" },
{ "name": "_additionalAmounts", "type": "uint256[]" }
],
"name": "additionalAction",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "pause",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "erc20Token",
"outputs": [{ "name": "", "type": "address" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [{ "name": "", "type": "address" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [{ "name": "", "type": "bytes32" }],
"name": "payerRefundAddress",
"outputs": [{ "name": "", "type": "address" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [{ "name": "_requestId", "type": "bytes32" }],
"name": "acceptAction",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{ "name": "", "type": "bytes32" },
{ "name": "", "type": "uint256" }
],
"name": "payeesPaymentAddress",
"outputs": [{ "name": "", "type": "address" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "name": "_rateFeesNumerator", "type": "uint256" },
{ "name": "_rateFeesDenominator", "type": "uint256" }
],
"name": "setRateFees",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "name": "_payeesIdAddress", "type": "address[]" },
{ "name": "_expectedAmounts", "type": "int256[]" },
{ "name": "_payerRefundAddress", "type": "address" },
{ "name": "_payeeAmounts", "type": "uint256[]" },
{ "name": "_additionals", "type": "uint256[]" },
{ "name": "_data", "type": "string" }
],
"name": "createRequestAsPayerAction",
"outputs": [{ "name": "requestId", "type": "bytes32" }],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [{ "name": "_newMaxFees", "type": "uint256" }],
"name": "setMaxCollectable",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "requestBurnerContract",
"outputs": [{ "name": "", "type": "address" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "maxFees",
"outputs": [{ "name": "", "type": "uint256" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "name": "_requestId", "type": "bytes32" },
{ "name": "_amountToRefund", "type": "uint256" }
],
"name": "refundAction",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [{ "name": "newOwner", "type": "address" }],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "name": "_requestCoreAddress", "type": "address" },
{ "name": "_requestBurnerAddress", "type": "address" },
{ "name": "_erc20Token", "type": "address" }
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "rateFeesNumerator",
"type": "uint256"
},
{
"indexed": false,
"name": "rateFeesDenominator",
"type": "uint256"
}
],
"name": "UpdateRateFees",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": false, "name": "maxFees", "type": "uint256" }
],
"name": "UpdateMaxFees",
"type": "event"
},
{ "anonymous": false, "inputs": [], "name": "Pause", "type": "event" },
{
"anonymous": false,
"inputs": [],
"name": "Unpause",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "name": "previousOwner", "type": "address" },
{ "indexed": true, "name": "newOwner", "type": "address" }
],
"name": "OwnershipTransferred",
"type": "event"
}
],
"version": "0.2.7",
"networks": {
"main": {
"address": "0xfa7b14e5e5e0b59ef6fb86f56928349eb607cbb3",
"blockNumber": 7515803
}
}
}

0 comments on commit c64cd41

Please sign in to comment.