Transaction #17305

Hash d62890535eae37cd23201103daf4f6cda2e8b1d7a82b51e087a10fc643628403
Status Success
Timestamp 1311 days ago - 10/15/2020, 6:21:40 PM UTC+0
Block 21255
Stamps Used 243
Burned Fee 0.06750000 TAU
From fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 28
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 7934c27db244bd8221c4ff4e2e233df6690876af521399e90286397209b79cb1f4a0b04958f80eda49059a7a711b30e0e45fa21c77f13523745a47866be26e01
Stamps Supplied 1000
Stamps per TAU 36

Kwargs

code import currency import submission supply = Variable() balances = Hash(default_value=0) owner = Variable() @construct def seed(amount=1_000_000): balances[ctx.caller] = amount supply.set(amount) owner.set(ctx.caller) @export def transfer(amount: float, to: str): 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 total_supply(): return supply.get() @export def allowance(main: str, spender: str): return balances[main, spender] @export def approve(amount: float, to: str): sender = ctx.caller balances[sender, to] += amount return balances[sender, to] @export def transfer_from(amount: float, to: str, main_account: str): 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 redeem(amount: float): assert balances[ctx.caller] >= amount, 'Not enough tokens to redeem!' assert amount > 0, 'Invalid amount!' balances[ctx.caller] -= amount share = amount / supply.get() reward = share * currency.balance_of(ctx.this) if reward > 0: currency.transfer(reward, ctx.caller) supply.set(supply.get() - amount) @export def change_ownership(new_owner: str): assert ctx.caller == owner.get(), 'Only the owner can change ownership!' owner.set(new_owner) @export def change_developer(contract: str, new_developer: str): assert ctx.caller == owner.get(), 'Only the owner can change the developer!' submission.change_developer(contract=contract, new_developer=new_developer)
name con_smackeroos_2

State Changes

Contract con_smackeroos_2
Variable balances
Key fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1
New Value 1000000
 
Contract con_smackeroos_2
Variable supply
New Value 1000000
 
Contract con_smackeroos_2
Variable owner
New Value fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1
 
Contract con_smackeroos_2
Variable __code__
New Value import currency import submission __supply = Variable(contract='con_smackeroos_2', name='supply') __balances = Hash(default_value=0, contract='con_smackeroos_2', name='balances' ) __owner = Variable(contract='con_smackeroos_2', name='owner') def ____(amount=1000000): __balances[ctx.caller] = amount __supply.set(amount) __owner.set(ctx.caller) @__export('con_smackeroos_2') def transfer(amount: float, to: str): sender = ctx.caller assert __balances[sender] >= amount, 'Not enough coins to send!' __balances[sender] -= amount __balances[to] += amount @__export('con_smackeroos_2') def balance_of(account: str): return __balances[account] @__export('con_smackeroos_2') def total_supply(): return __supply.get() @__export('con_smackeroos_2') def allowance(main: str, spender: str): return __balances[main, spender] @__export('con_smackeroos_2') def approve(amount: float, to: str): sender = ctx.caller __balances[sender, to] += amount return __balances[sender, to] @__export('con_smackeroos_2') def transfer_from(amount: float, to: str, main_account: str): 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_smackeroos_2') def redeem(amount: float): assert __balances[ctx.caller] >= amount, 'Not enough tokens to redeem!' assert amount > 0, 'Invalid amount!' __balances[ctx.caller] -= amount share = amount / __supply.get() reward = share * currency.balance_of(ctx.this) if reward > 0: currency.transfer(reward, ctx.caller) __supply.set(__supply.get() - amount) @__export('con_smackeroos_2') def change_ownership(new_owner: str): assert ctx.caller == __owner.get(), 'Only the owner can change ownership!' __owner.set(new_owner) @__export('con_smackeroos_2') def change_developer(contract: str, new_developer: str): assert ctx.caller == __owner.get( ), 'Only the owner can change the developer!' submission.change_developer(contract=contract, new_developer=new_developer)
 
Contract con_smackeroos_2
Variable __compiled__
New Value e300000000000000000000000005000000400000007310010000640064016c005a00640064016c015a0165026402640364048d025a03650464006402640564068d035a0565026402640764048d025a0664246409640a84015a076508640283016509650a640b9c02640c640d840483015a0b650864028301650a640e9c01640f6410840483015a0c65086402830164116412840083015a0d650864028301650a650a64139c0264146415840483015a0e6508640283016509650a640b9c0264166417840483015a0f6508640283016509650a650a64189c036419641a840483015a106508640283016509641b9c01641c641d840483015a11650864028301650a641e9c01641f6420840483015a12650864028301650a650a64219c0264226423840483015a13640153002925e9000000004eda10636f6e5f736d61636b65726f6f735f32da06737570706c792902da08636f6e7472616374da046e616d65da0862616c616e6365732903da0d64656661756c745f76616c756572040000007205000000da056f776e6572e940420f0063010000000000000001000000030000004300000073240000007c00740074016a023c0074036a047c008301010074056a0474016a02830101006400530029014e2906da0a5f5f62616c616e636573da03637478da0663616c6c6572da085f5f737570706c79da03736574da075f5f6f776e65722901da06616d6f756e74a9007211000000da00da045f5f5f5f09000000730600000000010a010a01721300000029027210000000da02746f630200000000000000030000000400000043000000733e00000074006a017d0274027c0219007c006b05731a740364018301820174027c02050019007c00380003003c0074027c01050019007c00370003003c006400530029024e7a194e6f7420656e6f75676820636f696e7320746f2073656e64212904720b000000720c000000720a000000da0e417373657274696f6e4572726f72290372100000007214000000da0673656e646572721100000072110000007212000000da087472616e736665720f0000007308000000000206011401100172170000002901da076163636f756e74630100000000000000010000000200000043000000730800000074007c001900530029014e2901720a00000029017218000000721100000072110000007212000000da0a62616c616e63655f6f6617000000730200000000027219000000630000000000000000000000000100000043000000730800000074006a018300530029014e2902720d000000da036765747211000000721100000072110000007212000000da0c746f74616c5f737570706c791c00000073020000000002721b0000002902da046d61696eda077370656e646572630200000000000000020000000300000043000000730c00000074007c007c0166021900530029014e2901720a0000002902721c000000721d000000721100000072110000007212000000da09616c6c6f77616e63652100000073020000000002721e000000630200000000000000030000000400000043000000732600000074006a017d0274027c027c016602050019007c00370003003c0074027c027c0166021900530029014e2903720b000000720c000000720a0000002903721000000072140000007216000000721100000072110000007212000000da07617070726f7665260000007306000000000206011401721f000000290372100000007214000000da0c6d61696e5f6163636f756e74630300000000000000040000000500000043000000737a00000074006a017d0374027c027c03660219007c006b05732e740364016a0474027c027c03660219007c0083028301820174027c0219007c006b057342740364028301820174027c027c036602050019007c00380003003c0074027c02050019007c00380003003c0074027c01050019007c00370003003c006400530029034e7a494e6f7420656e6f75676820636f696e7320617070726f76656420746f2073656e642120596f752068617665207b7d20616e642061726520747279696e6720746f207370656e64207b7d7a194e6f7420656e6f75676820636f696e7320746f2073656e64212905720b000000720c000000720a0000007215000000da06666f726d617429047210000000721400000072200000007216000000721100000072110000007212000000da0d7472616e736665725f66726f6d2d0000007310000000000206010a010c0112011401140110017222000000290172100000006301000000000000000300000004000000430000007380000000740074016a0219007c006b05731674036401830182017c0064026b0473267403640383018201740074016a02050019007c00380003003c007c0074046a0583001b007d017c0174066a0774016a08830114007d027c0264026b04726a74066a097c0274016a028302010074046a0a74046a0583007c001800830101006400530029044e7a1c4e6f7420656e6f75676820746f6b656e7320746f2072656465656d2172010000007a0f496e76616c696420616d6f756e7421290b720a000000720b000000720c0000007215000000720d000000721a000000da0863757272656e63797219000000da04746869737217000000720e00000029037210000000da057368617265da06726577617264721100000072110000007212000000da0672656465656d39000000731000000000021601100112010c01100108010e0172270000002901da096e65775f6f776e6572630100000000000000010000000200000043000000732400000074006a0174026a0383006b027316740464018301820174026a057c00830101006400530029024e7a244f6e6c7920746865206f776e65722063616e206368616e6765206f776e657273686970212906720b000000720c000000720f000000721a0000007215000000720e00000029017228000000721100000072110000007212000000da106368616e67655f6f776e65727368697045000000730400000000021601722900000029027204000000da0d6e65775f646576656c6f706572630200000000000000020000000400000043000000732800000074006a0174026a0383006b027316740464018301820174056a067c007c0164028d0201006400530029034e7a284f6e6c7920746865206f776e65722063616e206368616e67652074686520646576656c6f7065722129027204000000722a0000002907720b000000720c000000720f000000721a0000007215000000da0a7375626d697373696f6eda106368616e67655f646576656c6f70657229027204000000722a000000721100000072110000007212000000722c0000004b0000007306000000000210010601722c0000002901720900000029147223000000722b000000da085661726961626c65720d000000da0448617368720a000000720f0000007213000000da085f5f6578706f7274da05666c6f6174da0373747272170000007219000000721b000000721e000000721f000000722200000072270000007229000000722c0000007211000000721100000072110000007212000000da083c6d6f64756c653e01000000732c000000080108010c010e020c030a060601120706011004100506011204060112060601140b0601100b060110050601
 
Contract con_smackeroos_2
Variable __owner__
New Value null
 
Contract con_smackeroos_2
Variable __submitted__
New Value 2020,10,15,18,21,48,0
 
Contract con_smackeroos_2
Variable __developer__
New Value fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1
 
Contract currency
Variable balances
Key fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1
New Value 140.969444444444444300