2019-11-18 10:48:26 -04:00
|
|
|
const ERC20_ABI = [
|
|
|
|
{
|
|
|
|
constant: true,
|
|
|
|
inputs: [],
|
|
|
|
name: "name",
|
|
|
|
outputs: [
|
|
|
|
{
|
|
|
|
name: "",
|
|
|
|
type: "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
payable: false,
|
|
|
|
stateMutability: "view",
|
|
|
|
type: "function"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
constant: true,
|
|
|
|
type: "function",
|
|
|
|
name: "balanceOf",
|
2019-11-26 15:52:38 -04:00
|
|
|
inputs: [{ name: "owner", type: "address" }],
|
2019-11-18 10:48:26 -04:00
|
|
|
outputs: [{ name: "balance", type: "uint256" }],
|
|
|
|
stateMutability: "view"
|
2019-11-26 15:52:38 -04:00
|
|
|
}
|
2019-11-18 10:48:26 -04:00
|
|
|
];
|
|
|
|
|
2019-11-13 11:03:30 -04:00
|
|
|
module.exports = {
|
|
|
|
from: {
|
|
|
|
email: "noreply@teller.exchange",
|
2019-12-19 18:02:22 -04:00
|
|
|
name: "Teller"
|
2019-11-13 11:03:30 -04:00
|
|
|
},
|
|
|
|
templates: {
|
2019-11-26 19:07:17 -04:00
|
|
|
subscribe: "sign-up.md",
|
2020-01-02 15:27:38 -04:00
|
|
|
variables: {
|
|
|
|
url: "https://status-im.github.io/status-teller-network/build"
|
|
|
|
},
|
2019-11-13 11:03:30 -04:00
|
|
|
contracts: {
|
2020-01-02 16:18:36 -04:00
|
|
|
"0x23a6F0bdBd6b5e6DBe5768F3aA68DDC3acF610d8": {
|
2019-11-26 15:52:38 -04:00
|
|
|
"escrow-creation": {
|
|
|
|
ABI: {
|
|
|
|
name: "Created",
|
|
|
|
type: "event",
|
|
|
|
inputs: [
|
|
|
|
{ indexed: true, name: "offerId", type: "uint256" },
|
|
|
|
{ indexed: true, name: "seller", type: "address" },
|
|
|
|
{ indexed: true, name: "buyer", type: "address" },
|
|
|
|
{ indexed: false, name: "escrowId", type: "uint256" }
|
|
|
|
]
|
2019-11-13 14:12:06 -04:00
|
|
|
},
|
2019-11-26 15:52:38 -04:00
|
|
|
index: "seller",
|
2020-01-02 16:18:36 -04:00
|
|
|
template: "escrow-creation.md"
|
|
|
|
/*,
|
2019-11-27 10:48:38 -04:00
|
|
|
data: async (web3, returnValues) => {
|
|
|
|
// Example obtaining contract data
|
|
|
|
const SNT = new web3.eth.Contract(ERC20_ABI, "0x3C36db79598e7902b5D726af7C7d406d5Da8aF14");
|
|
|
|
return {
|
|
|
|
tokenName: await SNT.methods.name().call(),
|
|
|
|
balance: await SNT.methods.balanceOf(returnValues.seller).call()
|
|
|
|
};
|
2020-01-02 16:18:36 -04:00
|
|
|
}*/
|
2019-11-26 15:52:38 -04:00
|
|
|
},
|
|
|
|
"escrow-funded": {
|
|
|
|
ABI: {
|
|
|
|
name: "Funded",
|
|
|
|
type: "event",
|
|
|
|
inputs: [
|
|
|
|
{ indexed: true, name: "escrowId", type: "uint256" },
|
|
|
|
{ indexed: true, name: "buyer", type: "address" },
|
|
|
|
{ indexed: false, name: "expirationTime", type: "uint256" },
|
|
|
|
{ indexed: false, name: "amount", type: "uint256" }
|
|
|
|
]
|
2019-11-14 09:57:44 -04:00
|
|
|
},
|
2019-11-26 15:52:38 -04:00
|
|
|
index: "buyer",
|
2019-11-27 10:48:38 -04:00
|
|
|
template: "escrow-funded.md"
|
2019-11-26 15:52:38 -04:00
|
|
|
},
|
|
|
|
"escrow-paid": {
|
|
|
|
ABI: {
|
|
|
|
name: "Paid",
|
|
|
|
type: "event",
|
|
|
|
inputs: [
|
|
|
|
{ indexed: true, name: "escrowId", type: "uint256" },
|
|
|
|
{ indexed: true, name: "seller", type: "address" }
|
|
|
|
]
|
2019-11-20 16:19:16 -04:00
|
|
|
},
|
2019-11-26 15:52:38 -04:00
|
|
|
index: "seller",
|
2019-11-27 10:48:38 -04:00
|
|
|
template: "escrow-paid.md"
|
2019-11-26 15:52:38 -04:00
|
|
|
},
|
2019-12-19 18:02:22 -04:00
|
|
|
"escrow-released": {
|
|
|
|
ABI: {
|
|
|
|
name: "Released",
|
|
|
|
type: "event",
|
|
|
|
inputs: [
|
|
|
|
{ indexed: true, name: "escrowId", type: "uint256" },
|
2020-01-02 16:18:36 -04:00
|
|
|
{ indexed: true, name: "seller", type: "address" },
|
|
|
|
{ indexed: true, name: "buyer", type: "address" },
|
|
|
|
{ indexed: true, name: "isDispute", type: "bool" },
|
2019-12-19 18:02:22 -04:00
|
|
|
]
|
|
|
|
},
|
|
|
|
index: "buyer",
|
|
|
|
filter: async (web3, returnValues) => !returnValues.isDispute,
|
|
|
|
template: "escrow-released.md"
|
2020-01-02 16:18:36 -04:00
|
|
|
}
|
|
|
|
/*,
|
2019-11-26 15:52:38 -04:00
|
|
|
"dispute-release-buyer": {
|
|
|
|
// Dispute won by the buyer
|
|
|
|
ABI: {
|
|
|
|
name: "Released",
|
|
|
|
type: "event",
|
|
|
|
inputs: [
|
|
|
|
{ indexed: true, name: "escrowId", type: "uint256" },
|
|
|
|
{ indexed: true, name: "seller", type: "address" }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
index: "buyer", // (web3, returnValues, currentUser) => return true; If we want to use an indexer based on functions
|
|
|
|
filter: async (web3, returnValues) => returnValues.isDispute === true,
|
2019-11-27 10:48:38 -04:00
|
|
|
template: "dispute-release-buyer.md"
|
2020-01-02 16:18:36 -04:00
|
|
|
}*/
|
2019-11-13 11:03:30 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|