Skip to content

Instantly share code, notes, and snippets.

@KardanovIR
Created February 19, 2020 13:35
Show Gist options
  • Save KardanovIR/940bad2012b05489d00c36dfc567a6fc to your computer and use it in GitHub Desktop.
Save KardanovIR/940bad2012b05489d00c36dfc567a6fc to your computer and use it in GitHub Desktop.
@Callable(invoke)
func callMeBaby(uuid: String) = {
if (isInWhiteList(invoke.caller) && invoke.fee == 500000) then {
let id = extract(invoke.transactionId)
let callerAddress = toBase58String(invoke.caller.bytes)
ScriptResult(
WriteSet([
DataEntry(toBase58String(id), callerAddress + uuid)
]),
TransferSet([
ScriptTransfer(addressFromStringValue(callerAddress), invoke.fee, unit)
])
)
}
else
throw()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment