One Million Pixel Waves

1.ooo.ooo Pixels - 0.01 WAVES cada uno - Compra tu espacio en la blockchain de WAVES, ¡para siempre!

ENG ENG ITA ITA ESP ESP РУС РУС
Contrato Inteligente

Instrucciones:

Source:

let author = "MaDaMa Labs @daidalos"

# transactions' amounts and fees
let oneWaves = 100000000
let paiedAmount = 16 * oneWaves
let paiedTxFee = oneWaves / 100
let dataTxFee =  oneWaves / 20

# variable for slots
let square = 40
let startPos = 0
let endPos = 1000 * 1000 / square / square
let lastHeightForSale = 1434350

# account to pay
let addressToPayPublicKey = base58'CDCQgNAFkShqxYv88NXZJBWjoNJ8Yd7x3rx7APvuWNsD'
let addressToPay = addressFromPublicKey( addressToPayPublicKey )

# this account address
let mePublicKey = base58'7rmY9jh9rZCqHjaCPrvu8KFY27vM8775VqatNSgEgsqa'
let me = addressFromPublicKey( mePublicKey )

match (tx) {
    case  t:DataTransaction =>

        # extract the provided position value from the DataTransaction
        let insertPos = extract(getInteger(t.data, "pos"))

        # extract the payment transaction's id from the DataTransaction
        let copyright0 = "@tradisys_global validator for public DataTransaction method"
        let paymentTxId = extract(getString(t.data, "pTxId"))

        # check if the data satisfies the specified format
        let satisfiesFormat =
            size(t.data) == 4
            && isDefined(getInteger(t.data, "pos"))
            && isDefined(getString(t.data, toString(insertPos)))
            && isDefined(getString(t.data, "pTxId"))
            && isDefined(getBoolean(t.data, paymentTxId))
            && extract(getBoolean(t.data, paymentTxId)) == true

        # check if the pos number is in range or if pos number is endPos for burn paymentTxId
        let validPos = insertPos >= startPos && insertPos <= endPos

        # check if the new position was not used before or if pos number is endPos for burn paymentTxId
        let posNotUsed = !isDefined(getString(me, toString(insertPos))) || (insertPos == endPos)

        # check if the payment transaction was not used before (to prevent double-spending)
        let copyright1 = "@tradisys_global validator for public DataTransaction method"
        let txIdNotUsed = !isDefined(getBoolean(me, paymentTxId))
        
        # check if the data transaction is valid
        let dataTransactionIsValid = satisfiesFormat && validPos && posNotUsed && txIdNotUsed

        # extract the provided payment transaction from the blockchain
        let copyright2 = "@tradisys_global validator for public DataTransaction method"
        let paymentTx = transactionById(fromBase58String(paymentTxId))

        # calculated the final paied amount with height of transaction (if sale or not)
        let heightOfTx = extract(transactionHeightById(fromBase58String(paymentTxId)))
        let paiedAmountFinal = if(heightOfTx > lastHeightForSale) then paiedAmount else (paiedAmount / 5 * 4)
        
        let copyright3 = "@tradisys_global validator for public DataTransaction method"
        match (paymentTx)
        {
            case paymentTx : TransferTransaction =>
                # check if the data transaction is valid
                dataTransactionIsValid
                # check if the payment recipient is account to pay
                && paymentTx.recipient == addressToPay
                # check if the transfer amount exceeds the required minimum
                && paymentTx.amount >= paiedAmountFinal - paiedTxFee
                # check if the transferred asset is WAVES
                && !isDefined(paymentTx.assetId)
                # check if the DataTransaction is signed by the payment's sender
                && sigVerify(t.bodyBytes, t.proofs[0], paymentTx.senderPublicKey)
                # check if the fee is correct
                && t.fee == dataTxFee
            case _ => false
        }
    case _ => false
}

Binary:

AQQAAAAGYXV0aG9yAgAAABVNYURhTWEgTGFicyBAZGFpZGFsb3MEAAAACG9uZVdhdmVzAAAAAAAF9eEABAAAAAtwYWllZEFtb3VudAkAAGgAAAACAAAAAAAAAAAQBQAAAAhvbmVXYXZlcwQAAAAKcGFpZWRUeEZlZQkAAGkAAAACBQAAAAhvbmVXYXZlcwAAAAAAAAAAZAQAAAAJZGF0YVR4RmVlCQAAaQAAAAIFAAAACG9uZVdhdmVzAAAAAAAAAAAUBAAAAAZzcXVhcmUAAAAAAAAAACgEAAAACHN0YXJ0UG9zAAAAAAAAAAAABAAAAAZlbmRQb3MJAABpAAAAAgkAAGkAAAACCQAAaAAAAAIAAAAAAAAAA+gAAAAAAAAAA+gFAAAABnNxdWFyZQUAAAAGc3F1YXJlBAAAABFsYXN0SGVpZ2h0Rm9yU2FsZQAAAAAAABXi7gQAAAAVYWRkcmVzc1RvUGF5UHVibGljS2V5AQAAACCmkGzdUyWi5GOO607ndKCx3S3hvfL3bRDiWbzTbs5fPAQAAAAMY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AdHJhZGlzeXNfZ2xvYmFsIHZhbGlkYXRvciBmb3IgcHVibGljIERhdGFUcmFuc2FjdGlvbiBtZXRob2QEAAAAByRtYXRjaDEFAAAACXBheW1lbnRUeAMJAAABAAAAAgUAAAAHJG1hdGNoMQIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAAJcGF5bWVudFR4BQAAAAckbWF0Y2gxAwMDAwMFAAAAFmRhdGFUcmFuc2FjdGlvbklzVmFsaWQJAAAAAAAAAggFAAAACXBheW1lbnRUeAAAAAlyZWNpcGllbnQFAAAADGFkZHJlc3NUb1BheQcJAABnAAAAAggFAAAACXBheW1lbnRUeAAAAAZhbW91bnQJAABlAAAAAgUAAAAQcGFpZWRBbW91bnRGaW5hbAUAAAAKcGFpZWRUeEZlZQcJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAAlwYXltZW50VHgAAAAHYXNzZXRJZAcJAAH0AAAAAwgFAAAAAXQAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAF0AAAABnByb29mcwAAAAAAAAAAAAgFAAAACXBheW1lbnRUeAAAAA9zZW5kZXJQdWJsaWNLZXkHCQAAAAAAAAIIBQAAAAF0AAAAA2ZlZQUAAAAJZGF0YVR4RmVlBwcHsA8yCA==
It seems that your Internet connection if offline. Please verify and try again later.
(This popup will automatically disappear once connection comes back to life)