#0
nonstandard
0.00004000 BSV
Q!OlÈÃ"fß¡ý¢v6eÜ%èì4aâÞ³3VmQ®MÁ{"__cls":"class Vote {\n constructor(to, distributor, name, numberOfVotes, can1name, can1PK, can2name, can2PK //, \n // can3name, can3PK\n ) {\n this.votes = numberOfVotes;\n this._owners = [to]; // name of the election\n\n this.name = name;\n this.can1name = can1name;\n this.can2name = can2name; // this.can3name = can3name\n\n this.cand1PK = can1PK;\n this.cand2PK = can2PK; //this.cand3PK = can3PK\n\n this.distributor = distributor;\n }\n\n distribute(to) {\n if (this.votes < 1) {\n throw new Error(\"There are not enough votes to distribute\");\n }\n\n if (this._owners[0].toString() !== this.distributor.toString()) {\n throw new Error('You cannot send your vote to another person.');\n }\n\n this.votes -= 1;\n return new Vote(to, this.distributor, this.name, 1, this.can1name, this.cand1PK, this.can2name, this.cand2PK);\n }\n\n voteA() {\n console.log();\n this._owners = [this.cand1PK];\n }\n\n voteB() {\n this._owners = [this.cand2PK];\n } // voteC() {\n // this._owners = [this.cand3PK]\n // }\n\n\n}","__index":{"obj":0},"__args":["024f6cc8c32266dfa101fda27636651fdc259ee81bec340f61e28edeb333566d95","024f6cc8c32266dfa101fda27636651fdc259ee81bec340f61e28edeb333566d95","Test Election",1,"Candidate 1","02f7fe93a4946489bed069ae735da31ad0fc53c69e1f754e899a17d8d78b787c8c","Candidate 2","03c6625c07927fa17287e2e5b187567275fcc1200dbd1325c6b4fae72b47c97bde"],"__func":"constructor"}u
https://whatsonchain.com/tx/99b0fbde04f9d53e85aa60eaba7ac320dee1a83565cadacc7510f4b34d806535