#0
nonstandard
0.00004000 BSV
Q!#k^ñ %ë÷.W ÇFzy-À¢%'OJÿXò7Q®MH{"__cls":"class Vote {\r\n constructor(to, distributor, name, numberOfVotes, can1name, can1PK, can2name, can2PK, can3name, can3PK) {\r\n this.votes = numberOfVotes\r\n this._owners = [to]\r\n this.name = name\r\n this.can1name = can1name\r\n this.can2name = can2name\r\n this.can3name = can3name\r\n this.cand1PK = can1PK\r\n this.cand2PK = can2PK \r\n this.cand3PK = can3PK\r\n this.distributor = distributor\r\n }\r\n \r\n distribute(to) {\r\n if (this.votes < 1){ throw new Error(\"There are not enough votes to distribute\")}\r\n if (this._owners[0].toString() !== this.distributor.toString()){\r\n throw new Error('You cannot send your vote to another person.')\r\n }\r\n this.votes -= 1\r\n return new Vote(to,\r\n this.distributor, \r\n this.name, \r\n 1,\r\n this.can1name,\r\n this.cand1PK,\r\n this.can2name,\r\n this.cand2PK,\r\n this.can3name,\r\n this.cand3PK)\r\n }\r\n \r\n voteA(publicKey) {\r\n this._owners = [this.cand1PK]\r\n }\r\n \r\n voteB(publicKey) {\r\n this._owners = [this.cand2PK]\r\n }\r\n \r\n voteC(publicKey) {\r\n this._owners = [this.cand3PK]\r\n }\r\n }","__index":{"obj":0},"__args":["02236b5ef10f0025eb080cf72e5720c7467a792d0f90c0a225274f4aff1058f237","02236b5ef10f0025eb080cf72e5720c7467a792d0f90c0a225274f4aff1058f237","Democracy?",10,"Freedom","03f22f15c9374fe0cc93a1c611d55bd69a648371da51ee0a9aca64a948c0e36446","Tyranny","0332a2e5082c096696871a04476bede326154cd9df76cc66c43a0664e794d82075","Green Party","033d0867b966996e192538a1c433848502a5b30e020aa2ca4d9abcb5b957bdbb8e"],"__func":"constructor"}u
https://whatsonchain.com/tx/0bf77203c3b87dc509d6e027aba69fae161ed17cd32c4fea8257e4e4c2ad76f6