Transaction #79890

Hash 525a57fa052955090b9337ca8aeb90cca543fac745a79113bd8f24acbb178ff2
Status Success
Timestamp 1087 days ago - 5/23/2021, 9:58:31 PM UTC+0
Block 79287
Stamps Used 229
Burned Fee 0.03523077 TAU
From ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 700
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 9775b367358ccad993b3c84403016fe3fd0647ea3f2a7567dd9baa896f1ca6e2e1913727dbd92aaa14d61418bbfb3eb3a0c66801d27a1aab9f5350aab983590f
Stamps Supplied 250
Stamps per TAU 65

Kwargs

code random.seed() I = importlib owner = Variable() burn_rate = Variable() min_amount = Variable() max_amount = Variable() burn_address = Variable() @construct def init(): # Owner of this contract owner.set(ctx.caller) # Burn rate for lost flips in % burn_rate.set(10) # Min amount of tokens to bet min_amount.set(2500000) # Max amount of tokens to bet max_amount.set(10000000) # Burn tokens by sending to this address burn_address.set("0000000000000BURN0000000000000") @export def flip(amount: float, token_contract: str): error = "Amount must be equal to or greater than " + str(min_amount.get()) assert amount >= min_amount.get(), error error = "Amount must be equal to or less than " + str(max_amount.get()) assert amount <= max_amount.get(), error # Transfer tokens from user to contract I.import_module(token_contract).transfer_from( amount=amount, to=ctx.this, main_account=ctx.caller) # Randomly decide if user won or lost if random.choice([True, False]): # Transfer tokens from contract to user I.import_module(token_contract).transfer( amount=amount*2, to=ctx.caller) return "You WON" else: # Burn percent of bet amount I.import_module(token_contract).transfer( amount=amount/100*burn_rate.get(), to=burn_address.get()) return "You LOST" @export def adjust_burn(percent: float): error = "Only owner can adjust burn rate" assert ctx.caller == owner.get(), error error = "Wrong burn rate value" assert (percent >= 0 and percent <= 100), error burn_rate.set(percent) @export def adjust_min(amount: int): error = "Only owner can adjust min amount" assert ctx.caller == owner.get(), error min_amount.set(amount) @export def adjust_max(amount: int): error = "Only owner can adjust max amount" assert ctx.caller == owner.get(), error max_amount.set(amount) @export def pay_in(amount: float, token_contract: str): error = "Negative amount is not allowed" assert amount > 0, error # Transfer tokens from user to contract I.import_module(token_contract).transfer_from( amount=amount, to=ctx.this, main_account=ctx.caller) @export def pay_out(amount: float, token_contract: str): error = "Negative amount is not allowed" assert amount > 0, error error = "Only owner can payout tokens" assert ctx.caller == owner.get(), error # Transfer tokens from contract to owner I.import_module(token_contract).transfer( amount=amount, to=ctx.caller)
name con_gold_flip

State Changes

Contract con_gold_flip
Variable owner
New Value ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
 
Contract con_gold_flip
Variable burn_rate
New Value 10
 
Contract con_gold_flip
Variable min_amount
New Value 2500000
 
Contract con_gold_flip
Variable max_amount
New Value 10000000
 
Contract con_gold_flip
Variable burn_address
New Value 0000000000000BURN0000000000000
 
Contract con_gold_flip
Variable __code__
New Value random.seed() I = importlib __owner = Variable(contract='con_gold_flip', name='owner') __burn_rate = Variable(contract='con_gold_flip', name='burn_rate') __min_amount = Variable(contract='con_gold_flip', name='min_amount') __max_amount = Variable(contract='con_gold_flip', name='max_amount') __burn_address = Variable(contract='con_gold_flip', name='burn_address') def ____(): __owner.set(ctx.caller) __burn_rate.set(10) __min_amount.set(2500000) __max_amount.set(10000000) __burn_address.set('0000000000000BURN0000000000000') @__export('con_gold_flip') def flip(amount: float, token_contract: str): error = 'Amount must be equal to or greater than ' + str(__min_amount.get() ) assert amount >= __min_amount.get(), error error = 'Amount must be equal to or less than ' + str(__max_amount.get()) assert amount <= __max_amount.get(), error I.import_module(token_contract).transfer_from(amount=amount, to=ctx. this, main_account=ctx.caller) if random.choice([True, False]): I.import_module(token_contract).transfer(amount=amount * 2, to=ctx. caller) return 'You WON' else: I.import_module(token_contract).transfer(amount=amount / 100 * __burn_rate.get(), to=__burn_address.get()) return 'You LOST' @__export('con_gold_flip') def adjust_burn(percent: float): error = 'Only owner can adjust burn rate' assert ctx.caller == __owner.get(), error error = 'Wrong burn rate value' assert percent >= 0 and percent <= 100, error __burn_rate.set(percent) @__export('con_gold_flip') def adjust_min(amount: int): error = 'Only owner can adjust min amount' assert ctx.caller == __owner.get(), error __min_amount.set(amount) @__export('con_gold_flip') def adjust_max(amount: int): error = 'Only owner can adjust max amount' assert ctx.caller == __owner.get(), error __max_amount.set(amount) @__export('con_gold_flip') def pay_in(amount: float, token_contract: str): error = 'Negative amount is not allowed' assert amount > 0, error I.import_module(token_contract).transfer_from(amount=amount, to=ctx. this, main_account=ctx.caller) @__export('con_gold_flip') def pay_out(amount: float, token_contract: str): error = 'Negative amount is not allowed' assert amount > 0, error error = 'Only owner can payout tokens' assert ctx.caller == __owner.get(), error I.import_module(token_contract).transfer(amount=amount, to=ctx.caller)
 
Contract con_gold_flip
Variable __compiled__
New Value e3000000000000000000000000040000004000000073de00000065006a018300010065025a0365046400640164028d025a0565046400640364028d025a0665046400640464028d025a0765046400640564028d025a0865046400640664028d025a096407640884005a0a650b64008301650c650d64099c02640a640b840483015a0e650b64008301650c640c9c01640d640e840483015a0f650b640083016510640f9c0164106411840483015a11650b640083016510640f9c0164126413840483015a12650b64008301650c650d64099c0264146415840483015a13650b64008301650c650d64099c0264166417840483015a14641853002919da0d636f6e5f676f6c645f666c6970da056f776e65722902da08636f6e7472616374da046e616d65da096275726e5f72617465da0a6d696e5f616d6f756e74da0a6d61785f616d6f756e74da0c6275726e5f61646472657373630000000000000000000000000200000043000000733800000074006a0174026a038301010074046a0164018301010074056a0164028301010074066a0164038301010074076a016404830101006400530029054ee90a00000069a02526006980969800da1e303030303030303030303030304255524e303030303030303030303030302908da075f5f6f776e6572da03736574da03637478da0663616c6c6572da0b5f5f6275726e5f72617465da0c5f5f6d696e5f616d6f756e74da0c5f5f6d61785f616d6f756e74da0e5f5f6275726e5f61646472657373a90072130000007213000000da00da045f5f5f5f0a000000730a00000000010c010a010a010a0172150000002902da06616d6f756e74da0e746f6b656e5f636f6e747261637463020000000000000003000000050000004300000073ba0000006401740074016a028300830117007d027c0074016a0283006b05732474037c02830182016402740074046a028300830117007d027c0074046a0283006b01734874037c028301820174056a067c0183016a077c0074086a0974086a0a64038d030100740b6a0c6404640567028301728e74056a067c0183016a0d7c006406140074086a0a64078d0201006408530074056a067c0183016a0d7c0064091b00740e6a0283001400740f6a02830064078d020100640a530064005300290b4e7a28416d6f756e74206d75737420626520657175616c20746f206f722067726561746572207468616e207a25416d6f756e74206d75737420626520657175616c20746f206f72206c657373207468616e2029037216000000da02746fda0c6d61696e5f6163636f756e745446e9020000002902721600000072180000007a07596f7520574f4ee9640000007a08596f75204c4f53542910da037374727210000000da03676574da0e417373657274696f6e4572726f727211000000da0149da0d696d706f72745f6d6f64756c65da0d7472616e736665725f66726f6d720d000000da0474686973720e000000da0672616e646f6dda0663686f696365da087472616e73666572720f0000007212000000290372160000007217000000da056572726f72721300000072130000007214000000da04666c69701200000073180000000002100214011001140110010a010e011a0204021001140172270000002901da0770657263656e74630100000000000000020000000200000043000000734400000064017d0174006a0174026a0383006b02731a74047c018301820164027d017c0064036b05722e7c0064046b01733674047c018301820174056a067c00830101006400530029054e7a1f4f6e6c79206f776e65722063616e2061646a757374206275726e20726174657a1557726f6e67206275726e20726174652076616c7565e900000000721b0000002907720d000000720e000000720b000000721d000000721e000000720f000000720c000000290272280000007226000000721300000072130000007214000000da0b61646a7573745f6275726e25000000730a00000000020401160104011801722a00000029017216000000630100000000000000020000000200000043000000732800000064017d0174006a0174026a0383006b02731a74047c018301820174056a067c00830101006400530029024e7a204f6e6c79206f776e65722063616e2061646a757374206d696e20616d6f756e742907720d000000720e000000720b000000721d000000721e0000007210000000720c000000290272160000007226000000721300000072130000007214000000da0a61646a7573745f6d696e2e0000007306000000000204011601722b000000630100000000000000020000000200000043000000732800000064017d0174006a0174026a0383006b02731a74047c018301820174056a067c00830101006400530029024e7a204f6e6c79206f776e65722063616e2061646a757374206d617820616d6f756e742907720d000000720e000000720b000000721d000000721e0000007211000000720c000000290272160000007226000000721300000072130000007214000000da0a61646a7573745f6d6178350000007306000000000204011601722c000000630200000000000000030000000500000043000000733200000064017d027c0064026b04731474007c028301820174016a027c0183016a037c0074046a0574046a0664038d0301006400530029044e7a1e4e6567617469766520616d6f756e74206973206e6f7420616c6c6f776564722900000029037216000000721800000072190000002907721e000000721f00000072200000007221000000720d0000007222000000720e0000002903721600000072170000007226000000721300000072130000007214000000da067061795f696e3c00000073080000000002040110011001722d000000630200000000000000030000000400000043000000734800000064017d027c0064026b04731474007c028301820164037d0274016a0274036a0483006b02732e74007c028301820174056a067c0183016a077c0074016a0264048d0201006400530029054e7a1e4e6567617469766520616d6f756e74206973206e6f7420616c6c6f77656472290000007a1c4f6e6c79206f776e65722063616e207061796f757420746f6b656e732902721600000072180000002908721e000000720d000000720e000000720b000000721d000000721f000000722000000072250000002903721600000072170000007226000000721300000072130000007214000000da077061795f6f757444000000730a00000000020401100104011601722e0000004e29157223000000da0473656564da09696d706f72746c6962721f000000da085661726961626c65720b000000720f0000007210000000721100000072120000007215000000da085f5f6578706f7274da05666c6f6174721c0000007227000000722a000000da03696e74722b000000722c000000722d000000722e0000007213000000721300000072130000007214000000da083c6d6f64756c653e010000007326000000080104010c010c010c010c010c03080806011212060110080601100606011006060112070601
 
Contract con_gold_flip
Variable __owner__
New Value null
 
Contract con_gold_flip
Variable __submitted__
New Value 2021,5,23,21,58,32,0
 
Contract con_gold_flip
Variable __developer__
New Value ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
 
Contract currency
Variable balances
Key ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
New Value 21.660933176752128390