Transaction #58285

Hash 1823c53e7506ce52bf5b4206462cb7aa27fe10ef64e974ed6fe8d114d4250e36
Status Success
Timestamp 1136 days ago - 4/5/2021, 8:16:33 PM UTC+0
Block 58389
Stamps Used 194
Burned Fee 0.02984615 TAU
From ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 363
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature d3df9db357cb6bf62ed35fbc5e0e1b9181030e09629b4de06ba10dc4923c76434031bd3c71c6c3232e4e98f4d4b9f2ea61d4f834fa23b80b1447506f6fea4403
Stamps Supplied 1289
Stamps per TAU 65

Kwargs

code import currency random.seed() owner = Variable() min_amount = Variable() max_amount = Variable() multiplier = Variable() @construct def init(): owner.set(ctx.caller) min_amount.set(10) max_amount.set(50) multiplier.set(5) @export def roll(guess: int, amount: float): error = "Not a valid dice number" assert (guess >= 1 and guess <= 6), error error = "Min bet amount is " + str(min_amount.get()) assert amount >= min_amount.get(), error error = "Max bet amount is " + str(max_amount.get()) assert amount <= max_amount.get(), error balance = currency.balance_of(account=ctx.this) error = "Contract balance too low to pay for possible win" assert balance >= amount * multiplier.get(), error currency.transfer_from( amount=amount, to=ctx.this, main_account=ctx.caller) result = random.randint(1, 6) if result == guess: currency.transfer( amount=amount * multiplier.get(), to=ctx.caller) return result @export def pay_in(amount: float): currency.transfer_from( amount=amount, to=ctx.this, main_account=ctx.caller) @export def pay_out(amount: float): error = "Only the owner can request a payout" assert owner.get() == ctx.caller, error currency.transfer( amount=amount, to=ctx.caller) @export def adjust_min(amount: int): error = "Only the owner can adjust the min amount" assert owner.get() == ctx.caller, error min_amount.set(amount) @export def adjust_max(amount: int): error = "Only the owner can adjust the max amount" assert owner.get() == ctx.caller, error max_amount.set(amount)
name con_dice001

State Changes

Contract con_dice001
Variable owner
New Value ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
 
Contract con_dice001
Variable min_amount
New Value 10
 
Contract con_dice001
Variable max_amount
New Value 50
 
Contract con_dice001
Variable multiplier
New Value 5
 
Contract con_dice001
Variable __code__
New Value import currency random.seed() __owner = Variable(contract='con_dice001', name='owner') __min_amount = Variable(contract='con_dice001', name='min_amount') __max_amount = Variable(contract='con_dice001', name='max_amount') __multiplier = Variable(contract='con_dice001', name='multiplier') def ____(): __owner.set(ctx.caller) __min_amount.set(10) __max_amount.set(50) __multiplier.set(5) @__export('con_dice001') def roll(guess: int, amount: float): error = 'Not a valid dice number' assert guess >= 1 and guess <= 6, error error = 'Min bet amount is ' + str(__min_amount.get()) assert amount >= __min_amount.get(), error error = 'Max bet amount is ' + str(__max_amount.get()) assert amount <= __max_amount.get(), error balance = currency.balance_of(account=ctx.this) error = 'Contract balance too low to pay for possible win' assert balance >= amount * __multiplier.get(), error currency.transfer_from(amount=amount, to=ctx.this, main_account=ctx.caller) result = random.randint(1, 6) if result == guess: currency.transfer(amount=amount * __multiplier.get(), to=ctx.caller) return result @__export('con_dice001') def pay_in(amount: float): currency.transfer_from(amount=amount, to=ctx.this, main_account=ctx.caller) @__export('con_dice001') def pay_out(amount: float): error = 'Only the owner can request a payout' assert __owner.get() == ctx.caller, error currency.transfer(amount=amount, to=ctx.caller) @__export('con_dice001') def adjust_min(amount: int): error = 'Only the owner can adjust the min amount' assert __owner.get() == ctx.caller, error __min_amount.set(amount) @__export('con_dice001') def adjust_max(amount: int): error = 'Only the owner can adjust the max amount' assert __owner.get() == ctx.caller, error __max_amount.set(amount)
 
Contract con_dice001
Variable __compiled__
New Value e3000000000000000000000000040000004000000073bc000000640064016c005a0065016a028300010065036402640364048d025a0465036402640564048d025a0565036402640664048d025a0665036402640764048d025a076408640984005a08650964028301650a650b640a9c02640b640c840483015a0c650964028301650b640d9c01640e640f840483015a0d650964028301650b640d9c0164106411840483015a0e650964028301650a640d9c0164126413840483015a0f650964028301650a640d9c0164146415840483015a10640153002916e9000000004eda0b636f6e5f64696365303031da056f776e65722902da08636f6e7472616374da046e616d65da0a6d696e5f616d6f756e74da0a6d61785f616d6f756e74da0a6d756c7469706c696572630000000000000000000000000200000043000000732e00000074006a0174026a038301010074046a0164018301010074056a0164028301010074066a016403830101006400530029044ee90a000000e932000000e9050000002907da075f5f6f776e6572da03736574da03637478da0663616c6c6572da0c5f5f6d696e5f616d6f756e74da0c5f5f6d61785f616d6f756e74da0c5f5f6d756c7469706c696572a90072130000007213000000da00da045f5f5f5f09000000730800000000010c010a010a0172150000002902da056775657373da06616d6f756e7463020000000000000005000000050000004300000073d200000064017d027c0064026b0572147c0064036b01731c74007c02830182016404740174026a038300830117007d027c0174026a0383006b05734074007c02830182016405740174046a038300830117007d027c0174046a0383006b01736474007c028301820174056a0674076a0864068d017d0364077d027c037c0174096a03830014006b05738e74007c028301820174056a0a7c0174076a0874076a0b64088d030100740c6a0d6402640383027d047c047c006b0272ce74056a0e7c0174096a038300140074076a0b64098d0201007c045300290a4e7a174e6f7420612076616c69642064696365206e756d626572e901000000e9060000007a124d696e2062657420616d6f756e74206973207a124d61782062657420616d6f756e74206973202901da076163636f756e747a30436f6e74726163742062616c616e636520746f6f206c6f7720746f2070617920666f7220706f737369626c652077696e29037217000000da02746fda0c6d61696e5f6163636f756e7429027217000000721b000000290fda0e417373657274696f6e4572726f72da037374727210000000da036765747211000000da0863757272656e6379da0a62616c616e63655f6f66720e000000da04746869737212000000da0d7472616e736665725f66726f6d720f000000da0672616e646f6dda0772616e64696e74da087472616e73666572290572160000007217000000da056572726f72da0762616c616e6365da06726573756c74721300000072130000007214000000da04726f6c6c10000000731c00000000020401180110011401100114010e010401180114010c0108011801722a00000029017217000000630100000000000000010000000500000043000000731800000074006a017c0074026a0374026a0464018d0301006400530029024e29037217000000721b000000721c000000290572200000007223000000720e0000007222000000720f00000029017217000000721300000072130000007214000000da067061795f696e2200000073020000000002722b000000630100000000000000020000000400000043000000732e00000064017d0174006a01830074026a036b02731a74047c018301820174056a067c0074026a0364028d0201006400530029034e7a234f6e6c7920746865206f776e65722063616e20726571756573742061207061796f757429027217000000721b0000002907720c000000721f000000720e000000720f000000721d00000072200000007226000000290272170000007227000000721300000072130000007214000000da077061795f6f7574270000007306000000000204011601722c000000630100000000000000020000000200000043000000732800000064017d0174006a01830074026a036b02731a74047c018301820174056a067c00830101006400530029024e7a284f6e6c7920746865206f776e65722063616e2061646a75737420746865206d696e20616d6f756e742907720c000000721f000000720e000000720f000000721d0000007210000000720d000000290272170000007227000000721300000072130000007214000000da0a61646a7573745f6d696e2e0000007306000000000204011601722d000000630100000000000000020000000200000043000000732800000064017d0174006a01830074026a036b02731a74047c018301820174056a067c00830101006400530029024e7a284f6e6c7920746865206f776e65722063616e2061646a75737420746865206d617820616d6f756e742907720c000000721f000000720e000000720f000000721d0000007211000000720d000000290272170000007227000000721300000072130000007214000000da0a61646a7573745f6d6178350000007306000000000204011601722e000000291172200000007224000000da0473656564da085661726961626c65720c0000007210000000721100000072120000007215000000da085f5f6578706f7274da03696e74da05666c6f6174722a000000722b000000722c000000722d000000722e0000007213000000721300000072130000007214000000da083c6d6f64756c653e010000007320000000080108010c010c010c010c030807060112110601100406011006060110060601
 
Contract con_dice001
Variable __owner__
New Value null
 
Contract con_dice001
Variable __submitted__
New Value 2021,4,5,20,16,34,0
 
Contract con_dice001
Variable __developer__
New Value ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
 
Contract currency
Variable balances
Key ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
New Value 21.714786844444443156