Added extra templates
This commit is contained in:
parent
0b66661b9a
commit
37075a26d2
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<p>The seller was notified about this trade</p>
|
|
@ -1 +0,0 @@
|
|||
The seller was notified about this trade
|
|
@ -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>
|
|
@ -0,0 +1,2 @@
|
|||
Your trade has been funded.
|
||||
Proceed to make the payment.
|
|
@ -0,0 +1,2 @@
|
|||
<h3>Your trade has been funded.</h3>
|
||||
<p>Proceed to make the payment.</p>
|
|
@ -0,0 +1,2 @@
|
|||
Your trade has been paid by the buyer.
|
||||
Verify you have received the payment and release the funds.
|
|
@ -1 +1 @@
|
|||
<p>Signup email</p>
|
||||
<p>Welcome to teller network!</p>
|
|
@ -1 +1 @@
|
|||
Signup email
|
||||
Welcome to teller network!
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue