Created
December 9, 2020 09:10
-
-
Save ccoincash/dedd386a0d2a9368868ef0ceaad2127f to your computer and use it in GitHub Desktop.
sell token for bsv
This file contains hidden or 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
import "util.scrypt"; | |
contract TokenSellContract { | |
Ripemd160 bsvRecAddr; | |
int bsvRecAmount; | |
public function unlock( | |
SigHashPreimage txPreimage | |
) { | |
SigHashType sigHashType = SigHash.SINGLE | SigHash.FORKID; | |
require(Util.checkPreimageSigHashType(txPreimage, sigHashType)); | |
bytes outputScript = Util.buildPublicKeyHashScript(this.bsvRecAddr); | |
bytes output = Util.buildOutput(outputScript, this.bsvRecAmount); | |
require(hash256(output) == Util.hashOutputs(txPreimage)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment