Added extra templates

This commit is contained in:
Richard Ramos 2019-11-14 09:57:44 -04:00
parent 0b66661b9a
commit 37075a26d2
13 changed files with 66 additions and 20 deletions

View File

@ -20,9 +20,10 @@ const config = {
/* Email */
SENDGRID_API_KEY: secret.SENDGRID_API_KEY,
/* WATCHER */
BLOCK_DELAY: 12, // 15-170 secs
EVENTS_RANGE: 20, // blocks
POLL_SLEEP: 2 // seconds
// With this example, if current block is 100, it will wait until block 108 to query blocks 101-103
BLOCK_DELAY: 5, // 60 secs... this could be helpful to avoid reorgs
EVENTS_RANGE: 3, // blocks
POLL_SLEEP: 1 // seconds
};
module.exports = config;

View File

@ -10,9 +10,9 @@ module.exports = {
text: "sign-up.txt"
},
contracts: {
"0xEE301C6A57e2fBf593F558C1aE52B20485101fC2": {
"0xFCC8175384c199C3Bc7a43c3583CbdcEf74ceC24": {
events: {
"escrow-creation-seller": {
"escrow-creation": {
ABI: {
name: "Created",
type: "event",
@ -26,26 +26,42 @@ module.exports = {
index: "seller",
template: {
subject: "New trade!",
html: "escrow-creation-seller.html",
text: "escrow-creation-seller.txt"
html: "escrow-creation.html",
text: "escrow-creation.txt"
}
},
"escrow-creation-buyer": {
"escrow-funded": {
ABI: {
name: "Created",
name: "Funded",
type: "event",
inputs: [
{ indexed: true, name: "offerId", type: "uint256" },
{ indexed: true, name: "seller", type: "address" },
{ indexed: true, name: "escrowId", type: "uint256" },
{ indexed: true, name: "buyer", type: "address" },
{ indexed: false, name: "escrowId", type: "uint256" }
{ indexed: false, name: "expirationTime", type: "uint256" },
{ indexed: false, name: "amount", type: "uint256" }
]
},
index: "buyer",
template: {
subject: "New trade!",
html: "escrow-creation-buyer.html",
text: "escrow-creation-buyer.txt"
subject: "Your escrow has been funded!",
html: "escrow-funded.html",
text: "escrow-funded.txt"
}
},
"escrow-paid": {
ABI: {
name: "Paid",
type: "event",
inputs: [
{ indexed: true, name: "escrowId", type: "uint256" },
{ indexed: true, name: "seller", type: "address" }
]
},
index: "seller",
template: {
subject: "Your escrow has been paid!",
html: "escrow-paid.html",
text: "escrow-paid.txt"
}
}
}

View File

@ -1 +0,0 @@
<p>The seller was notified about this trade</p>

View File

@ -1 +0,0 @@
The seller was notified about this trade

View File

@ -0,0 +1,2 @@
<h3>Your trade has been paid by the buyer.</h3>
<p>Verify you have received the payment and release the funds.</p>

View File

@ -0,0 +1,2 @@
Your trade has been funded.
Proceed to make the payment.

View File

@ -0,0 +1,2 @@
<h3>Your trade has been funded.</h3>
<p>Proceed to make the payment.</p>

View File

@ -0,0 +1,2 @@
Your trade has been paid by the buyer.
Verify you have received the payment and release the funds.

View File

@ -1 +1 @@
<p>Signup email</p>
<p>Welcome to teller network!</p>

View File

@ -1 +1 @@
Signup email
Welcome to teller network!

View File

@ -2,8 +2,31 @@ pragma solidity >=0.5.0 <0.6.0;
contract Escrow {
event Created(uint indexed offerId, address indexed seller, address indexed buyer, uint escrowId);
event Funded(uint indexed escrowId, address indexed buyer, uint expirationTime, uint amount);
event Paid(uint indexed escrowId, address indexed seller);
event Released(uint indexed escrowId, address indexed seller, address indexed buyer);
event Canceled(uint indexed escrowId, address indexed seller, address indexed buyer);
function create() public {
emit Created(block.number, msg.sender, msg.sender, block.number);
emit Created(101, msg.sender, msg.sender, block.number);
}
function funded() public {
emit Funded(block.number, msg.sender, block.number, 20);
}
function paid() public {
emit Paid(block.number, msg.sender);
}
function released() public {
emit Released(block.number, msg.sender, msg.sender);
}
function canceled() public {
emit Canceled(block.number, msg.sender, msg.sender);
}
}