-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
72 lines (62 loc) · 1.52 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const provider = new ethers.providers.Web3Provider(window.ethereum);
const transferCryptoTestamentContract = new ethers.Contract(transTestaABI, transTestaADDRESS, provider.getSigner());
class Contract {
let addressContract;
let addressOwner;
let timeLeft;
let total;
let remain;
constructor(addressContract){
this.addressContract=addressContract;
}
addressOwner=getOwner(addressContract);
timeLeft=getTime(addressContract);
total=getTotal;
remain=getRemain;
const Beneficiaris= getBeneficiaris().split(` `);
getOwner(addressContract){
const owner = transferCryptoTestamentContract.getOwner();
return owner;
}
getTime(addressContract){
}
getTotal(addressContract){
const total = transferCryptoTestamentContract.getMount();
return total;
}
getRemain(addressContract){
const remain = transferCryptoTestamentContract.getRemain();
return remain;
}
//String split by ' ', split it to beneficiaris
getBeneficiaris(addressContract){
const lisBeneficiaries = transferCryptoTestamentContract.getBeneficiaris();
return lisBeneficiaries;
}
rollUp(){
}
executeTestament(){
}
withdraw(){
}
sendEth(){
}
addBeneficiary(address,percent){
}
}
class IoDatabase{
let record={addressContract:0,timeLeft:0};
readData(){
//read from StillLive.txt and write to Testament active
}
modifiedData(){
//write or remove record
}
}
class InteractContract{
contract=new Contract(addressContract);
//write details about contract
updateContract(){
//modified beneficiaries
}
}