Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {-# STDLIB_VERSION 3 #-}
- {-# CONTENT_TYPE DAPP #-}
- {-# SCRIPT_TYPE ACCOUNT #-}
- func getExtValueItemWhiteListStatus(item: String) = {
- item + "_verifier_status"
- }
- let verifier = "3Mtzmtfh13ihJ3nJyyxT9zUvZRUKmNVDMa5"
- let FEATURED = "featured"
- let DELISTED = "delisted"
- @Callable(i)
- func setstatus(supplier: String, status: String) = {
- let account = toBase58String(i.caller.bytes)
- let hash = toBase58String(sha256(toBytes(supplier + status)))
- if ( account != verifier ) then throw("only oracle veryfier are able to manage whitelist")
- else if ( status != FEATURED && status != DELISTED ) then throw("wrong status")
- else {
- WriteSet([
- DataEntry(getExtValueItemWhiteListStatus(supplier), status),
- DataEntry("supplier+status_" + supplier + status, hash)
- ])
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement