-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fetch UTXOs for Local Wallet from Scrypt API
Include Scrypt Artifacts fix build
- Loading branch information
Showing
21 changed files
with
616 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
contract EventTicket { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[[],[[9,0,30,13]],[]] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
|
||
contract Meeting { | ||
@state bytes title; | ||
@state bytes description; | ||
@state bytes location; | ||
@state bytes url; | ||
@state bytes status; | ||
@state int start; | ||
@state int end; | ||
@state PubKey organizer; | ||
@state HashedSet<PubKey> attendees; | ||
VarIntReader __scrypt_ts_accessPathReaderForProp__attendees; | ||
@state HashedSet<PubKey> invitees; | ||
VarIntReader __scrypt_ts_accessPathReaderForProp__invitees; | ||
@state bool cancelled; | ||
@state bool inviteRequired; | ||
constructor(bytes title, bytes description, int start, int end, bytes location, bytes url, bytes status, PubKey organizer, HashedSet<PubKey> invitees, HashedSet<PubKey> attendees, bool inviteRequired) { | ||
this.title = title; | ||
this.description = description; | ||
this.start = start; | ||
this.end = end; | ||
this.location = location; | ||
this.url = url; | ||
this.status = status; | ||
this.organizer = organizer; | ||
this.invitees = invitees; | ||
this.inviteRequired = inviteRequired; | ||
this.attendees = attendees; | ||
this.cancelled = false; | ||
} | ||
public function uncancel(Sig sig, SigHashPreimage __scrypt_ts_txPreimage, int __scrypt_ts_changeAmount, Ripemd160 __scrypt_ts_changeAddress) { | ||
require(Tx.checkPreimageSigHashType(__scrypt_ts_txPreimage, SigHashType(b'41'))); | ||
require(checkSig(sig, this.organizer)); | ||
this.cancelled = false; | ||
bytes outputs = this.buildStateOutput(SigHash.value(__scrypt_ts_txPreimage)); | ||
if(__scrypt_ts_changeAmount > 0) { | ||
outputs += (__scrypt_ts_changeAmount > 0 ? Utils.buildOutput(Utils.buildPublicKeyHashScript(__scrypt_ts_changeAddress), __scrypt_ts_changeAmount) : b''); | ||
} | ||
require(SigHash.hashOutputs(__scrypt_ts_txPreimage) == hash256(outputs)); | ||
} | ||
public function invite(PubKey invitee, Sig sig, SigHashPreimage __scrypt_ts_txPreimage, int __scrypt_ts_changeAmount, Ripemd160 __scrypt_ts_changeAddress, bytes __scrypt_ts_accessPathForProp__attendees, bytes __scrypt_ts_accessPathForProp__invitees) { | ||
require(Tx.checkPreimageSigHashType(__scrypt_ts_txPreimage, SigHashType(b'41'))); | ||
this.__scrypt_ts_accessPathReaderForProp__attendees = new VarIntReader(__scrypt_ts_accessPathForProp__attendees); | ||
this.__scrypt_ts_accessPathReaderForProp__invitees = new VarIntReader(__scrypt_ts_accessPathForProp__invitees); | ||
require(checkSig(sig, this.organizer)); | ||
if(!this.invitees.has({invitee, this.__scrypt_ts_accessPathReaderForProp__invitees.readInt()}) && !this.attendees.has({invitee, this.__scrypt_ts_accessPathReaderForProp__attendees.readInt()})) { | ||
require(this.invitees.add({invitee, this.__scrypt_ts_accessPathReaderForProp__invitees.readInt()})); | ||
} | ||
bytes outputs = this.buildStateOutput(SigHash.value(__scrypt_ts_txPreimage)); | ||
if(__scrypt_ts_changeAmount > 0) { | ||
outputs += (__scrypt_ts_changeAmount > 0 ? Utils.buildOutput(Utils.buildPublicKeyHashScript(__scrypt_ts_changeAddress), __scrypt_ts_changeAmount) : b''); | ||
} | ||
require(SigHash.hashOutputs(__scrypt_ts_txPreimage) == hash256(outputs)); | ||
} | ||
public function decline(PubKey pubkey, Sig sig, SigHashPreimage __scrypt_ts_txPreimage, int __scrypt_ts_changeAmount, Ripemd160 __scrypt_ts_changeAddress, bytes __scrypt_ts_accessPathForProp__attendees, bytes __scrypt_ts_accessPathForProp__invitees) { | ||
require(Tx.checkPreimageSigHashType(__scrypt_ts_txPreimage, SigHashType(b'41'))); | ||
this.__scrypt_ts_accessPathReaderForProp__attendees = new VarIntReader(__scrypt_ts_accessPathForProp__attendees); | ||
this.__scrypt_ts_accessPathReaderForProp__invitees = new VarIntReader(__scrypt_ts_accessPathForProp__invitees); | ||
require(checkSig(sig, pubkey)); | ||
if(this.invitees.has({pubkey, this.__scrypt_ts_accessPathReaderForProp__invitees.readInt()})) { | ||
this.invitees.delete({pubkey, this.__scrypt_ts_accessPathReaderForProp__invitees.readInt()}); | ||
} | ||
if(this.attendees.has({pubkey, this.__scrypt_ts_accessPathReaderForProp__attendees.readInt()})) { | ||
this.attendees.delete({pubkey, this.__scrypt_ts_accessPathReaderForProp__attendees.readInt()}); | ||
} | ||
bytes outputs = this.buildStateOutput(SigHash.value(__scrypt_ts_txPreimage)); | ||
if(__scrypt_ts_changeAmount > 0) { | ||
outputs += (__scrypt_ts_changeAmount > 0 ? Utils.buildOutput(Utils.buildPublicKeyHashScript(__scrypt_ts_changeAddress), __scrypt_ts_changeAmount) : b''); | ||
} | ||
require(SigHash.hashOutputs(__scrypt_ts_txPreimage) == hash256(outputs)); | ||
} | ||
public function attend(PubKey pubkey, Sig sig, SigHashPreimage __scrypt_ts_txPreimage, int __scrypt_ts_changeAmount, Ripemd160 __scrypt_ts_changeAddress, bytes __scrypt_ts_accessPathForProp__attendees, bytes __scrypt_ts_accessPathForProp__invitees) { | ||
require(Tx.checkPreimageSigHashType(__scrypt_ts_txPreimage, SigHashType(b'41'))); | ||
this.__scrypt_ts_accessPathReaderForProp__attendees = new VarIntReader(__scrypt_ts_accessPathForProp__attendees); | ||
this.__scrypt_ts_accessPathReaderForProp__invitees = new VarIntReader(__scrypt_ts_accessPathForProp__invitees); | ||
require(checkSig(sig, pubkey)); | ||
if(this.inviteRequired) { | ||
require(this.invitees.has({pubkey, this.__scrypt_ts_accessPathReaderForProp__invitees.readInt()}) || pubkey == this.organizer); | ||
} | ||
require(this.attendees.add({pubkey, this.__scrypt_ts_accessPathReaderForProp__attendees.readInt()})); | ||
bytes outputs = this.buildStateOutput(SigHash.value(__scrypt_ts_txPreimage)); | ||
if(__scrypt_ts_changeAmount > 0) { | ||
outputs += (__scrypt_ts_changeAmount > 0 ? Utils.buildOutput(Utils.buildPublicKeyHashScript(__scrypt_ts_changeAddress), __scrypt_ts_changeAmount) : b''); | ||
} | ||
require(SigHash.hashOutputs(__scrypt_ts_txPreimage) == hash256(outputs)); | ||
} | ||
public function cancel(Sig sig, SigHashPreimage __scrypt_ts_txPreimage, int __scrypt_ts_changeAmount, Ripemd160 __scrypt_ts_changeAddress) { | ||
require(Tx.checkPreimageSigHashType(__scrypt_ts_txPreimage, SigHashType(b'41'))); | ||
require(checkSig(sig, this.organizer)); | ||
this.cancelled = true; | ||
bytes outputs = this.buildStateOutput(SigHash.value(__scrypt_ts_txPreimage)); | ||
if(__scrypt_ts_changeAmount > 0) { | ||
outputs += (__scrypt_ts_changeAmount > 0 ? Utils.buildOutput(Utils.buildPublicKeyHashScript(__scrypt_ts_changeAddress), __scrypt_ts_changeAmount) : b''); | ||
} | ||
require(SigHash.hashOutputs(__scrypt_ts_txPreimage) == hash256(outputs)); | ||
} | ||
function buildStateOutput(int amount): bytes { | ||
bytes script = this.getStateScript(); | ||
return Utils.buildOutput(script, amount); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[[],[[9,0,12,13]],[[9,0,14,11],[15,0,14,4]],[[9,0,17,17],[15,0,17,4]],[[9,0,20,14],[15,0,20,4]],[[9,0,23,9],[15,0,23,4]],[[9,0,26,12],[15,0,26,4]],[[9,0,29,11],[13,0,29,4]],[[9,0,32,9],[13,0,32,4]],[[9,0,35,15],[16,0,35,4]],[[9,0,38,15],[19,0,38,15],[25,0,38,15],[27,0,38,4]],[],[[9,0,41,14],[19,0,41,14],[25,0,41,14],[27,0,41,4]],[],[[9,0,44,15],[14,0,44,4]],[[9,0,47,20],[14,0,47,4]],[[2,0,49,4],[14,0,50,13],[20,0,50,6],[27,0,51,19],[33,0,51,6],[46,0,52,13],[50,0,52,6],[57,0,53,11],[61,0,53,6],[66,0,54,16],[72,0,54,6],[82,0,55,11],[88,0,55,6],[93,0,57,14],[99,0,57,6],[107,0,58,17],[114,0,58,6],[125,0,59,16],[135,0,59,16],[141,0,59,16],[143,0,59,6],[153,0,60,17],[163,0,60,17],[169,0,60,17],[171,0,60,6],[182,0,61,22],[187,0,61,6]],[[4,0,64,8],[8,0,64,13],[15,0,64,8],[17,0,64,21]],[[4,0,65,8],[8,0,65,13],[21,0,65,8],[23,0,65,27]],[[4,0,66,8],[8,0,66,13],[15,0,66,8],[17,0,66,21]],[[4,0,67,8],[8,0,67,13],[13,0,67,8],[15,0,67,19]],[[4,0,68,8],[8,0,68,13],[18,0,68,8],[20,0,68,24]],[[4,0,69,8],[8,0,69,13],[13,0,69,8],[15,0,69,19]],[[4,0,70,8],[8,0,70,13],[16,0,70,8],[18,0,70,22]],[[4,0,72,8],[8,0,72,13],[19,0,72,8],[21,0,72,25]],[[4,0,73,8],[8,0,73,13],[18,0,73,8],[20,0,73,24]],[[4,0,74,8],[8,0,74,13],[24,0,74,8],[26,0,74,30]],[[4,0,75,8],[8,0,75,13],[19,0,75,8],[21,0,75,25]],[[4,0,76,8],[8,0,76,13],[19,0,76,8],[21,0,76,25]],[],[[2,0,80,4],[18,0,80,11],[27,0,80,25],[31,0,80,20]],[],[[4,0,82,8],[12,0,82,20],[20,0,82,15],[21,0,82,29],[26,0,82,34],[30,0,82,39],[40,0,82,15]],[[4,0,84,8],[8,0,84,13],[19,0,84,8],[21,0,84,25]],[[4,0,86,21],[10,0,86,12],[20,0,86,34],[24,0,86,39],[49,0,86,70]],[[4,0,87,8],[32,0,87,12],[34,0,87,32]],[[8,0,87,38],[16,0,87,38],[19,0,87,49]],[],[[4,0,88,8],[19,0,88,24],[56,0,88,15],[59,0,88,39],[67,0,88,47]],[],[[2,0,93,4],[18,0,93,11],[25,0,93,27],[32,0,93,18],[41,0,93,40],[45,0,93,35]],[],[],[],[[4,0,95,8],[12,0,95,20],[20,0,95,15],[21,0,95,29],[26,0,95,34],[30,0,95,39],[40,0,95,15]],[[4,0,97,8],[7,0,97,12],[8,0,97,13],[12,0,97,18],[21,0,97,27],[27,0,97,31],[99,0,97,12],[102,0,97,43],[103,0,97,44],[107,0,97,49],[117,0,97,59],[123,0,97,63]],[[16,0,98,10],[20,0,98,15],[29,0,98,24],[35,0,98,28]],[],[[4,0,101,21],[10,0,101,12],[20,0,101,34],[24,0,101,39],[49,0,101,70]],[[4,0,102,8],[32,0,102,12],[34,0,102,32]],[[8,0,102,38],[16,0,102,38],[19,0,102,49]],[],[[4,0,103,8],[19,0,103,24],[56,0,103,15],[59,0,103,39],[67,0,103,47]],[],[[2,0,108,4],[18,0,108,11],[26,0,108,27],[33,0,108,19],[41,0,108,40],[45,0,108,35]],[],[],[],[[4,0,110,6],[12,0,110,18],[20,0,110,13],[21,0,110,27],[26,0,110,32],[32,0,110,13]],[[4,0,112,6],[7,0,112,10],[11,0,112,15],[20,0,112,24],[26,0,112,28]],[[8,0,114,8],[12,0,114,13],[21,0,114,22],[30,0,114,29]],[],[[4,0,118,6],[7,0,118,10],[11,0,118,15],[21,0,118,25],[27,0,118,29]],[[8,0,120,8],[12,0,120,13],[22,0,120,23],[31,0,120,30]],[],[[4,0,124,19],[10,0,124,10],[20,0,124,32],[24,0,124,37],[49,0,124,68]],[[4,0,125,6],[32,0,125,10],[34,0,125,30]],[[8,0,125,36],[16,0,125,36],[19,0,125,47]],[],[[4,0,126,6],[19,0,126,22],[56,0,126,13],[59,0,126,37],[67,0,126,45]],[],[[2,0,131,4],[18,0,131,11],[25,0,131,26],[32,0,131,18],[40,0,131,39],[44,0,131,34]],[],[],[],[[4,0,133,6],[12,0,133,18],[20,0,133,13],[21,0,133,27],[26,0,133,32],[32,0,133,13]],[[4,0,135,6],[7,0,135,10],[11,0,135,15]],[[8,0,136,8],[16,0,136,15],[20,0,136,20],[29,0,136,29],[35,0,136,33],[106,0,136,15],[109,0,136,44],[116,0,136,44],[119,0,136,54],[123,0,136,59]],[],[[12,0,139,6],[16,0,139,11],[26,0,139,21],[32,0,139,25]],[[4,0,141,19],[10,0,141,10],[20,0,141,32],[24,0,141,37],[49,0,141,68]],[[4,0,142,6],[32,0,142,10],[34,0,142,30]],[[8,0,142,36],[16,0,142,36],[19,0,142,47]],[],[[4,0,143,6],[19,0,143,22],[56,0,143,13],[59,0,143,37],[67,0,143,45]],[],[[2,0,160,4],[18,0,160,11],[25,0,160,23],[29,0,160,18]],[],[[4,0,162,8],[12,0,162,20],[20,0,162,15],[21,0,162,29],[26,0,162,34],[30,0,162,39],[40,0,162,15]],[[4,0,164,8],[8,0,164,13],[19,0,164,8],[21,0,164,25]],[[4,0,166,21],[10,0,166,12],[20,0,166,34],[24,0,166,39],[49,0,166,70]],[[4,0,167,8],[32,0,167,12],[34,0,167,32]],[[8,0,167,38],[16,0,167,38],[19,0,167,49]],[],[[4,0,168,8],[19,0,168,24],[56,0,168,15],[59,0,168,39],[67,0,168,47]],[],[],[],[],[],[]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"success": true, | ||
"errors": [], | ||
"scryptfile": "meeting.scrypt", | ||
"sourceMapFile": "meeting.scrypt.map", | ||
"ctxMethods": [ | ||
"uncancel", | ||
"invite", | ||
"decline", | ||
"attend", | ||
"cancel" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
contract NextPowCo { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[[],[[9,0,11,13]],[]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"version": 9, | ||
"compilerVersion": "1.19.0+commit.72eaeba", | ||
"contract": "PersonalInterest", | ||
"md5": "6a2cf3924b54e783d80d858ad16a8108", | ||
"structs": [], | ||
"library": [], | ||
"alias": [], | ||
"abi": [ | ||
{ | ||
"type": "function", | ||
"name": "setWeight", | ||
"index": 0, | ||
"params": [ | ||
{ | ||
"name": "weight", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "signature", | ||
"type": "Sig" | ||
}, | ||
{ | ||
"name": "__scrypt_ts_txPreimage", | ||
"type": "SigHashPreimage" | ||
}, | ||
{ | ||
"name": "__scrypt_ts_changeAmount", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "__scrypt_ts_changeAddress", | ||
"type": "Ripemd160" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "function", | ||
"name": "remove", | ||
"index": 1, | ||
"params": [ | ||
{ | ||
"name": "signature", | ||
"type": "Sig" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "constructor", | ||
"params": [ | ||
{ | ||
"name": "topic", | ||
"type": "bytes" | ||
}, | ||
{ | ||
"name": "owner", | ||
"type": "PubKey" | ||
}, | ||
{ | ||
"name": "weight", | ||
"type": "int" | ||
} | ||
] | ||
} | ||
], | ||
"stateProps": [ | ||
{ | ||
"name": "weight", | ||
"type": "int" | ||
} | ||
], | ||
"buildType": "debug", | ||
"file": "file:///Users/zyler/Desktop/scrypt-nextjs-demo/artifacts/personalInterest.scrypt", | ||
"hex": "0176018801a901ac2097dfd76851bf465e8f715593b217714858bbe9570ff3bd5e33840a34e20ff0262102ba79df5f8ae7604a9830f03c7933028186aede0675a16f025dc4f8be8eec0382201008ce7480da41702918d1ec8e6849ba32b4d65b1e40dc669c31a1e6306b266c00000000<topic><owner><weight>615279567a75557a557a557a557a557a5179577a75567a567a567a567a567a567a0079557a75547a547a547a547a757575615b790087635e7961007901687f776100005279517f75007f77007901fd87635379537f75517f7761007901007e81517a7561537a75527a527a5379535479937f75537f77527a75517a67007901fe87635379557f75517f7761007901007e81517a7561537a75527a527a5379555479937f75557f77527a75517a67007901ff87635379597f75517f7761007901007e81517a7561537a75527a527a5379595479937f75597f77527a75517a675379517f75007f7761007901007e81517a7561537a75527a527a5379515479937f75517f77527a75517a6868685179517a75517a75517a75517a7561517a7561007961007982775179517951947f755179549451947f77007981527951799454945194517a75517a75517a75517a7561517951797f75537a75527a527a0000537953797f77610079537a75527a527a00527a75517a7561615179517951937f7551797f775179768b537a75527a527a75010051798791517a7561007991636161005379005179557951937f7555797f77815579768b577a75567a567a567a567a567a567a750079014c9f630079547a75537a537a537a527956795579937f7556797f77527a75517a670079014c9c635279567951937f7556797f7761007901007e81517a7561547a75537a537a537a55795193567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670079014d9c635279567952937f7556797f7761007901007e81517a7561547a75537a537a537a55795293567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670079014e9c635279567954937f7556797f7761007901007e81517a7561547a75537a537a537a55795493567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670069686868685579547993567a75557a557a557a557a557a5579755179517a75517a75517a75517a75618161577a75567a567a567a567a567a567a6801137901416151795e795e79210ac407f0e4bd44bfc207355a778b046225a7068fc59ee7eda43ad905aadbffc800206c266b30e6a1319c66dc401e5bd6b432ba49688eecd118297041da8074ce081060795679615679aa0079610079517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e01007e81517a75615779567956795679567961537956795479577995939521414136d08c5ed2bf3ba048afe6dcaebafeffffffffffffffffffffffffffffff00517951796151795179970079009f63007952799367007968517a75517a75517a7561527a75517a517951795296a0630079527994527a75517a6853798277527982775379012080517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e01205279947f7754537993527993013051797e527e54797e58797e527e53797e52797e57797e0079517a75517a75517a75517a75517a75517a75517a75517a75517a75517a75517a75517a75517a756100795779ac517a75517a75517a75517a75517a75517a75517a75517a75517a7561517a75517a7561690114795979ac69011579577a75567a567a567a567a567a567a011379610079610079827751795179012c947f7551790134947f77517a75517a756161007901007e81517a7561517a75610079616100610079635167010068517a75615979610079009c630100670079686100798277005179014c9f63517951615179517951938000795179827751947f75007f77517a75517a75517a7561517a756751790200019f63014c527951615179517951938000795179827751947f75007f77517a75517a75517a75617e517a75675179030000019f63014d527952615179517951938000795179827751947f75007f77517a75517a75517a75617e517a756751790500000000019f63014e527954615179517951938000795179827751947f75007f77517a75517a75517a75617e517a7567006968686868007953797e517a75517a75517a7561517a75617e5879517961007982775480517951797e0051807e517a75517a75617e517a75610079527961007958805279610079827700517902fd009f63517951615179517951938000795179827751947f75007f77517a75517a75517a7561517a75675179030000019f6301fd527952615179517951938000795179827751947f75007f77517a75517a75517a75617e517a756751790500000000019f6301fe527954615179517951938000795179827751947f75007f77517a75517a75517a75617e517a75675179090000000000000000019f6301ff527958615179517951938000795179827751947f75007f77517a75517a75517a75617e517a7568686868007953797e517a75517a75517a75617e517a75517a7561517a75517a756101147900a063007901157900a063011479610113790112797e01147e51797e0113797e0111797e517a756101167961007958805279610079827700517902fd009f63517951615179517951938000795179827751947f75007f77517a75517a75517a7561517a75675179030000019f6301fd527952615179517951938000795179827751947f75007f77517a75517a75517a75617e517a756751790500000000019f6301fe527954615179517951938000795179827751947f75007f77517a75517a75517a75617e517a75675179090000000000000000019f6301ff527958615179517951938000795179827751947f75007f77517a75517a75517a75617e517a7568686868007953797e517a75517a75517a75617e517a75517a75616700687e517a750079756801157961007982775179517958947f7551790128947f77517a75517a75615179aa87777777777777777777777777777777777777777777777777675b795187635c795479ac7777777777777777777777777767006868", | ||
"sourceMapFile": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
contract PersonalInterest { | ||
PubKey owner; | ||
bytes topic; | ||
@state int weight; | ||
constructor(bytes topic, PubKey owner, int weight) { | ||
this.topic = topic; | ||
this.owner = owner; | ||
this.weight = weight; | ||
} | ||
public function setWeight(int weight, Sig signature, SigHashPreimage __scrypt_ts_txPreimage, int __scrypt_ts_changeAmount, Ripemd160 __scrypt_ts_changeAddress) { | ||
require(Tx.checkPreimageSigHashType(__scrypt_ts_txPreimage, SigHashType(b'41'))); | ||
require(checkSig(signature, this.owner)); | ||
this.weight = weight; | ||
int amount = SigHash.value(__scrypt_ts_txPreimage); | ||
bytes outputs = this.buildStateOutput(amount); | ||
if(__scrypt_ts_changeAmount > 0) { | ||
outputs += (__scrypt_ts_changeAmount > 0 ? Utils.buildOutput(Utils.buildPublicKeyHashScript(__scrypt_ts_changeAddress), __scrypt_ts_changeAmount) : b''); | ||
} | ||
require(SigHash.hashOutputs(__scrypt_ts_txPreimage) == hash256(outputs)); | ||
} | ||
public function remove(Sig signature) { | ||
require(checkSig(signature, this.owner)); | ||
} | ||
function buildStateOutput(int amount): bytes { | ||
bytes script = this.getStateScript(); | ||
return Utils.buildOutput(script, amount); | ||
} | ||
} |
Oops, something went wrong.