Hash:

bdb4c20dd31dda950b9019d2b89cd0dfb1dfd528cab074af6d8ae01ba268d0fa
Status
Success
Timestamp
12/29/2020, 3:25:54 PM
Result
None
Block Number
3565
SubBlock Number
0
Nonce
330
Processor
89f67bb871351a1629d66676e4bd92bbacb23bd0649b890542ef98f1b664a497
Stamps Used
265 ( 20.4 dTAU )
Contract Name
submission
Function Name
submit_contract
Signature
c7a639575a75de5faafa7668af715cfb8eff41a7983bc9dab9d590fefaba05a387d717f6428d6f92b3cff9816a65c7adf8cdacb84ae0af586a0d4c48e3da660f

Kwargs

code
import currency balances = Hash(default_value=0) operator = Variable() @construct def seed(vk: str, amount: int): operator.set(vk) balances[vk] = amount balances['pre_sale'] = [200, 600, 2000] balances['wp'] = [50, 150, 500] @export def warrior_point(option: int): sender = ctx.caller owner = operator.get() cost = balances['pre_sale'] wp = balances['wp'] assert currency.balance_of(sender) >= cost[option], 'Balance too low to create a post!' currency.transfer_from(int(cost[option]), owner, sender) balances[sender] += wp[option] balances[owner] -= wp[option] if option == 2: balances[sender,'tickets'] +=1 @export def transfer(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' sender = ctx.caller assert balances[sender] >= amount, 'Not enough coins to send!' balances[sender] -= amount balances[to] += amount @export def balance_of(account: str): return balances[account] @export def allowance(owner: str, spender: str): return balances[owner, spender] @export def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' sender = ctx.caller balances[sender, to] += amount return balances[sender, to] @export def transfer_from(amount: float, to: str, main_account: str): assert amount > 0, 'Cannot send negative balances!' sender = ctx.caller assert balances[main_account, sender ] >= amount, 'Not enough coins approved to send! You have {} and are trying to spend {}'.format( balances[main_account, sender], amount) assert balances[main_account] >= amount, 'Not enough coins to send!' balances[main_account, sender] -= amount balances[main_account] -= amount balances[to] += amount @export def minted(amount: float): assert_owner() owner = operator.get() balances[owner] += amount @export def change_owner(vk: str): assert_owner() operator.set(vk) @export def change_values(value: str, opt:int, amount: float): assert_owner() option = balances[value] option[otp] = amount def assert_owner(): assert ctx.caller == operator.get(), 'Only operator can call!'
constructor_args
{"amount":100000,"vk":"554bdec75c364c067e03f9d4113a2dab177f424d45122902a128d9590fba7880"}
name
con_underground

State Changes

Contract
con_underground
Variable
operator
New Value
554bdec75c364c067e03f9d4113a2dab177f424d45122902a128d9590fba7880
Contract
con_underground
Variable
balances
New Value
100,000
Contract
con_underground
Variable
balances
Key
pre_sale
New Value
[200,600,2000]
Contract
con_underground
Variable
balances
Key
wp
New Value
[50,150,500]
Contract
con_underground
Variable
__code__
New Value
import currency __balances = Hash(default_value=0, contract='con_underground', name='balances') __operator = Variable(contract='con_underground', name='operator') def ____(vk: str, amount: int): __operator.set(vk) __balances[vk] = amount __balances['pre_sale'] = [200, 600, 2000] __balances['wp'] = [50, 150, 500] @__export('con_underground') def warrior_point(option: int): sender = ctx.caller owner = __operator.get() cost = __balances['pre_sale'] wp = __balances['wp'] assert currency.balance_of(sender) >= cost[option ], 'Balance too low to create a post!' currency.transfer_from(int(cost[option]), owner, sender) __balances[sender] += wp[option] __balances[owner] -= wp[option] if option == 2: __balances[sender, 'tickets'] += 1 @__export('con_underground') def transfer(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' sender = ctx.caller assert __balances[sender] >= amount, 'Not enough coins to send!' __balances[sender] -= amount __balances[to] += amount @__export('con_underground') def balance_of(account: str): return __balances[account] @__export('con_underground') def allowance(owner: str, spender: str): return __balances[owner, spender] @__export('con_underground') def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' sender = ctx.caller __balances[sender, to] += amount return __balances[sender, to] @__export('con_underground') def transfer_from(amount: float, to: str, main_account: str): assert amount > 0, 'Cannot send negative balances!' sender = ctx.caller assert __balances[main_account, sender ] >= amount, 'Not enough coins approved to send! You have {} and are trying to spend {}'.format( __balances[main_account, sender], amount) assert __balances[main_account] >= amount, 'Not enough coins to send!' __balances[main_account, sender] -= amount __balances[main_account] -= amount __balances[to] += amount @__export('con_underground') def minted(amount: float): __assert_owner() owner = __operator.get() __balances[owner] += amount @__export('con_underground') def change_owner(vk: str): __assert_owner() __operator.set(vk) @__export('con_underground') def change_values(value: str, opt: int, amount: float): __assert_owner() option = __balances[value] option[otp] = amount def __assert_owner(): assert ctx.caller == __operator.get(), 'Only operator can call!'
Contract
con_underground
Variable
__compiled__
New Value
{"__bytes__":"e300000000000000000000000005000000400000007312010000640064016c005a00650164006402640364048d035a0265036402640564068d025a046505650664079c026408640984045a076508640283016506640a9c01640b640c840483015a09650864028301650a6505640d9c02640e640f840483015a0b650864028301650564109c0164116412840483015a0c6508640283016505650564139c0264146415840483015a0d650864028301650a6505640d9c0264166417840483015a0e650864028301650a6505650564189c036419641a840483015a0f650864028301650a641b9c01641c641d840483015a106508640283016505641e9c01641f6420840483015a1165086402830165056506650a64219c0364226423840483015a126424642584005a13640153002926e9000000004eda0f636f6e5f756e64657267726f756e64da0862616c616e6365732903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da086f70657261746f722902720500000072060000002902da02766bda06616d6f756e74630200000000000000020000000300000043000000733200000074006a017c00830101007c0174027c003c006401640264036703740264043c006405640664076703740264083c006400530029094ee9c8000000695802000069d0070000da087072655f73616c65e932000000e99600000069f4010000da0277702903da0a5f5f6f70657261746f72da03736574da0a5f5f62616c616e636573290272080000007209000000a9007212000000da00da045f5f5f5f06000000730800000000010a0108010e0172140000002901da066f7074696f6e630100000000000000050000000500000043000000739600000074006a017d0174026a0383007d027404640119007d037404640219007d0474056a067c0183017c037c0019006b057338740764038301820174056a0874097c037c00190083017c027c018303010074047c01050019007c047c001900370003003c0074047c02050019007c047c001900380003003c007c0064046b02729274047c0164056602050019006406370003003c006400530029074e720b000000720e0000007a2142616c616e636520746f6f206c6f7720746f20637265617465206120706f737421e902000000da077469636b657473e901000000290ada03637478da0663616c6c6572720f000000da036765747211000000da0863757272656e6379da0a62616c616e63655f6f66da0e417373657274696f6e4572726f72da0d7472616e736665725f66726f6dda03696e7429057215000000da0673656e646572da056f776e6572da04636f7374720e000000721200000072120000007213000000da0d77617272696f725f706f696e740d000000731600000000020601080108010801140106011601140114010801722400000029027209000000da02746f630200000000000000030000000400000043000000734e0000007c0064016b047310740064028301820174016a027d0274037c0219007c006b05732a740064038301820174037c02050019007c00380003003c0074037c01050019007c00370003003c006400530029044e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a194e6f7420656e6f75676820636f696e7320746f2073656e64212904721e0000007219000000721a00000072110000002903720900000072250000007221000000721200000072120000007213000000da087472616e736665721c000000730a0000000002100106011401100172260000002901da076163636f756e74630100000000000000010000000200000043000000730800000074007c001900530029014e2901721100000029017227000000721200000072120000007213000000721d0000002500000073020000000002721d00000029027222000000da077370656e646572630200000000000000020000000300000043000000730c00000074007c007c0166021900530029014e29017211000000290272220000007228000000721200000072120000007213000000da09616c6c6f77616e63652a00000073020000000002722900000063020000000000000003000000040000004300000073360000007c0064016b047310740064028301820174016a027d0274037c027c016602050019007c00370003003c0074037c027c0166021900530029034e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573212904721e0000007219000000721a00000072110000002903720900000072250000007221000000721200000072120000007213000000da07617070726f76652f00000073080000000002100106011401722a000000290372090000007225000000da0c6d61696e5f6163636f756e74630300000000000000040000000500000043000000738a0000007c0064016b047310740064028301820174016a027d0374037c027c03660219007c006b05733e740064036a0474037c027c03660219007c0083028301820174037c0219007c006b057352740064048301820174037c027c036602050019007c00380003003c0074037c02050019007c00380003003c0074037c01050019007c00370003003c006400530029054e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a494e6f7420656e6f75676820636f696e7320617070726f76656420746f2073656e642120596f752068617665207b7d20616e642061726520747279696e6720746f207370656e64207b7d7a194e6f7420656e6f75676820636f696e7320746f2073656e64212905721e0000007219000000721a0000007211000000da06666f726d6174290472090000007225000000722b0000007221000000721200000072120000007213000000721f0000003700000073120000000002100106010a010c011201140114011001721f00000029017209000000630100000000000000020000000400000043000000732200000074008300010074016a0283007d0174037c01050019007c00370003003c006400530029014e2904da0e5f5f6173736572745f6f776e6572720f000000721b0000007211000000290272090000007222000000721200000072120000007213000000da066d696e746564440000007306000000000206010801722e00000029017208000000630100000000000000010000000200000043000000731400000074008300010074016a027c00830101006400530029014e2903722d000000720f000000721000000029017208000000721200000072120000007213000000da0c6368616e67655f6f776e65724b000000730400000000020601722f0000002903da0576616c7565da036f70747209000000630300000000000000040000000300000043000000731a00000074008300010074017c0019007d037c027c0374023c006400530029014e2903722d0000007211000000da036f747029047230000000723100000072090000007215000000721200000072120000007213000000da0d6368616e67655f76616c7565735100000073060000000002060108017233000000630000000000000000000000000200000043000000731a00000074006a0174026a0383006b02731674046401830182016400530029024e7a174f6e6c79206f70657261746f722063616e2063616c6c2129057219000000721a000000720f000000721b000000721e0000007212000000721200000072120000007213000000722d0000005800000073020000000001722d0000002914721c000000da04486173687211000000da085661726961626c65720f000000da0373747272200000007214000000da085f5f6578706f72747224000000da05666c6f61747226000000721d0000007229000000722a000000721f000000722e000000722f0000007233000000722d0000007212000000721200000072120000007213000000da083c6d6f64756c653e01000000732c00000008010e010c0310070601100e060112080601100406011204060112070601140c060110060601100506011406"}
Contract
con_underground
Variable
__owner__
New Value
NULL
Contract
con_underground
Variable
__submitted__
New Value
{"__time__":[2020,12,29,15,25,55,0]}
Contract
con_underground
Variable
__developer__
New Value
757c03fef2a1c041ea0173081e19c4e908b77b7e0bbd87f7bb06402cdc7983ae
Contract
currency
Variable
balances
New Value
883,575.05649925850620359098947567999