Transaction #190528

Hash 4ae24ebfbeca78c3a6a29e33e03b1dc0c734d7e9af48594f14e7fcfa57d5f741
Status Success
Timestamp 52 days ago - 9/2/2021, 8:40:39 AM UTC+0
Block 187175
Stamps Used 292
Burned Fee 0.04492308 TAU
From ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 1989
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 14267c7bbee354b4dd98bf4b99854c8e3fd46bead8dae974fc755b489d4030e87102c7c1fea7636a33807c95f44eb1bf895a6189454ef0a0c3281b96ebc4f60b
Stamps Supplied 3250
Stamps per TAU 65

Kwargs

code data = Hash(default_value=0) active = Variable() tau_amount = Variable() price_contract = Variable() price_variable = Variable() neb_contract = Variable() vault_variable = Variable() INTERNAL_VAULT = 'INTERNAL_NEB_VAULT' BURN_ADDRESS = 'NEBULA_BURN_ADDRESS' OPERATORS = [ 'ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d', 'e787ed5907742fa8d50b3ca2701ab8e03ec749ced806a15cdab800a127d7f863' ] @construct def init(): active.set(True) tau_amount.set(1) price_contract.set('con_rocketswap_official_v1_1') price_variable.set('prices') neb_contract.set('con_nebula') vault_variable.set('vault_contract') @export def subscribe(): assert active.get() == True, 'Contract disabled' neb_price = ForeignHash(foreign_contract=price_contract.get(), foreign_name=price_variable.get()) neb_amount = int(tau_amount.get() / neb_price[neb_contract.get()]) neb = importlib.import_module(neb_contract.get()) neb.transfer_from(amount=neb_amount, to=ctx.this, main_account=ctx.caller) data[ctx.caller] += neb_amount data[ctx.caller, 'start'] = now @export def unsubscribe(): assert data[ctx.caller] > 0, 'You are not subscribed!' total_amount = int(data[ctx.caller]) time_delta = now - data[ctx.caller, 'start'] if time_delta <= datetime.timedelta(days=30): payout = data[ctx.caller] / 100 * 30 elif time_delta <= datetime.timedelta(days=90): payout = data[ctx.caller] / 100 * 50 elif time_delta <= datetime.timedelta(days=120): payout = data[ctx.caller] / 100 * 70 else: payout = data[ctx.caller] / 100 * 80 neb = importlib.import_module(neb_contract.get()) # Pay back user neb.transfer(amount=int(payout), to=ctx.caller) # Amount of NEB going to the vault amount_delta = data[ctx.caller] - payout vault = ForeignVariable(foreign_contract=neb_contract.get(), foreign_name=vault_variable.get()) if not vault.get(): vault = Variable() vault.set(INTERNAL_VAULT) # Send delta amount to vault neb.transfer(amount=int(amount_delta), to=vault.get()) data[ctx.caller] = 0 return 'Payed out {} NEB from {} NEB'.format(int(payout), total_amount) @export def enable(): assert_owner() active.set(True) @export def disable(): assert_owner() active.set(False) @export def set_tau_amount(amount: int): assert_owner() assert amount >= 0, 'Amount of TAU can not be negative' tau_amount.set(amount) @export def set_price_interface(contract: str, variable: str): assert_owner() price_contract.set(contract) price_variable.set(variable) @export def set_vault_interface(contract: str, variable: str): assert_owner() neb_contract.set(contract) vault_variable.set(variable) def assert_owner(): assert ctx.caller in OPERATORS, 'Only executable by operators!'
name con_ape_test005

State Changes

Contract con_ape_test005
Variable active
New Value true
 
Contract con_ape_test005
Variable tau_amount
New Value 1
 
Contract con_ape_test005
Variable price_contract
New Value con_rocketswap_official_v1_1
 
Contract con_ape_test005
Variable price_variable
New Value prices
 
Contract con_ape_test005
Variable neb_contract
New Value con_nebula
 
Contract con_ape_test005
Variable vault_variable
New Value vault_contract
 
Contract con_ape_test005
Variable __code__
New Value __data = Hash(default_value=0, contract='con_ape_test005', name='data') __active = Variable(contract='con_ape_test005', name='active') __tau_amount = Variable(contract='con_ape_test005', name='tau_amount') __price_contract = Variable(contract='con_ape_test005', name='price_contract') __price_variable = Variable(contract='con_ape_test005', name='price_variable') __neb_contract = Variable(contract='con_ape_test005', name='neb_contract') __vault_variable = Variable(contract='con_ape_test005', name='vault_variable') INTERNAL_VAULT = 'INTERNAL_NEB_VAULT' BURN_ADDRESS = 'NEBULA_BURN_ADDRESS' OPERATORS = ['ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d' , 'e787ed5907742fa8d50b3ca2701ab8e03ec749ced806a15cdab800a127d7f863'] def ____(): __active.set(True) __tau_amount.set(1) __price_contract.set('con_rocketswap_official_v1_1') __price_variable.set('prices') __neb_contract.set('con_nebula') __vault_variable.set('vault_contract') @__export('con_ape_test005') def subscribe(): assert __active.get() == True, 'Contract disabled' __neb_price = ForeignHash(foreign_contract=__price_contract.get(), foreign_name=__price_variable.get(), contract='con_ape_test005', name='neb_price') neb_amount = int(__tau_amount.get() / __neb_price[__neb_contract.get()]) neb = importlib.import_module(__neb_contract.get()) neb.transfer_from(amount=neb_amount, to=ctx.this, main_account=ctx.caller) __data[ctx.caller] += neb_amount __data[ctx.caller, 'start'] = now @__export('con_ape_test005') def unsubscribe(): assert __data[ctx.caller] > 0, 'You are not subscribed!' total_amount = int(__data[ctx.caller]) time_delta = now - __data[ctx.caller, 'start'] if time_delta <= datetime.timedelta(days=30): payout = __data[ctx.caller] / 100 * 30 elif time_delta <= datetime.timedelta(days=90): payout = __data[ctx.caller] / 100 * 50 elif time_delta <= datetime.timedelta(days=120): payout = __data[ctx.caller] / 100 * 70 else: payout = __data[ctx.caller] / 100 * 80 neb = importlib.import_module(__neb_contract.get()) neb.transfer(amount=int(payout), to=ctx.caller) amount_delta = __data[ctx.caller] - payout __vault = ForeignVariable(foreign_contract=__neb_contract.get(), foreign_name=__vault_variable.get(), contract='con_ape_test005', name='vault') if not __vault.get(): __vault = Variable(contract='con_ape_test005', name='vault') __vault.set(INTERNAL_VAULT) neb.transfer(amount=int(amount_delta), to=__vault.get()) __data[ctx.caller] = 0 return 'Payed out {} NEB from {} NEB'.format(int(payout), total_amount) @__export('con_ape_test005') def enable(): __assert_owner() __active.set(True) @__export('con_ape_test005') def disable(): __assert_owner() __active.set(False) @__export('con_ape_test005') def set_tau_amount(amount: int): __assert_owner() assert amount >= 0, 'Amount of TAU can not be negative' __tau_amount.set(amount) @__export('con_ape_test005') def set_price_interface(contract: str, variable: str): __assert_owner() __price_contract.set(contract) __price_variable.set(variable) @__export('con_ape_test005') def set_vault_interface(contract: str, variable: str): __assert_owner() __neb_contract.set(contract) __vault_variable.set(variable) def __assert_owner(): assert ctx.caller in OPERATORS, 'Only executable by operators!'
 
Contract con_ape_test005
Variable __compiled__
New Value e300000000000000000000000005000000400000007300010000650064006401640264038d035a0165026401640464058d025a0365026401640664058d025a0465026401640764058d025a0565026401640864058d025a0665026401640964058d025a0765026401640a64058d025a08640b5a09640c5a0a640d640e67025a0b640f641084005a0c650d6401830164116412840083015a0e650d6401830164136414840083015a0f650d6401830164156416840083015a10650d6401830164176418840083015a11650d64018301651264199c01641a641b840483015a13650d6401830165146514641c9c02641d641e840483015a15650d6401830165146514641c9c02641f6420840483015a166421642284005a17642353002924e900000000da0f636f6e5f6170655f74657374303035da04646174612903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da06616374697665290272050000007206000000da0a7461755f616d6f756e74da0e70726963655f636f6e7472616374da0e70726963655f7661726961626c65da0c6e65625f636f6e7472616374da0e7661756c745f7661726961626c65da12494e5445524e414c5f4e45425f5641554c54da134e4542554c415f4255524e5f41444452455353da4061653764313464366439623834343366383831626136323434373237623639623638313031306537383264346665343832646266623062366163613032643564da4065373837656435393037373432666138643530623363613237303161623865303365633734396365643830366131356364616238303061313237643766383633630000000000000000000000000200000043000000734000000074006a0164018301010074026a0164028301010074036a0164038301010074046a0164048301010074056a0164058301010074066a016406830101006400530029074e54e901000000da1c636f6e5f726f636b6574737761705f6f6666696369616c5f76315f31da06707269636573da0a636f6e5f6e6562756c61da0e7661756c745f636f6e74726163742907da085f5f616374697665da03736574da0c5f5f7461755f616d6f756e74da105f5f70726963655f636f6e7472616374da105f5f70726963655f7661726961626c65da0e5f5f6e65625f636f6e7472616374da105f5f7661756c745f7661726961626c65a900721d000000721d000000da00da045f5f5f5f0e000000730c00000000010a010a010a010a010a01721f000000630000000000000000030000000600000043000000738a00000074006a01830064016b0273147402640283018201740374046a01830074056a0183006403640464058d047d00740674076a0183007c0074086a01830019001b0083017d0174096a0a74086a01830083017d027c026a0b7c01740c6a0d740c6a0e64068d030100740f740c6a0e050019007c01370003003c007410740f740c6a0e640766023c006400530029084e547a11436f6e74726163742064697361626c65647202000000da096e65625f70726963652904da10666f726569676e5f636f6e7472616374da0c666f726569676e5f6e616d65720500000072060000002903da06616d6f756e74da02746fda0c6d61696e5f6163636f756e74da05737461727429117216000000da03676574da0e417373657274696f6e4572726f72da0b466f726569676e486173687219000000721a000000da03696e747218000000721b000000da09696d706f72746c6962da0d696d706f72745f6d6f64756c65da0d7472616e736665725f66726f6dda03637478da0474686973da0663616c6c6572da065f5f64617461da036e6f772903da0b5f5f6e65625f7072696365da0a6e65625f616d6f756e74da036e6562721d000000721d000000721e000000da097375627363726962651700000073120000000002140108010801080118010e01140112017236000000630000000000000000060000000600000043000000734c010000740074016a02190064016b04731674036402830182017404740074016a02190083017d007405740074016a0264036602190018007d017c0174066a07640464058d016b01725a740074016a02190064061b00640414007d026e5a7c0174066a07640764058d016b01727e740074016a02190064061b00640814007d026e367c0174066a07640964058d016b0172a2740074016a02190064061b00640a14007d026e12740074016a02190064061b00640b14007d0274086a09740a6a0b830083017d037c036a0c74047c02830174016a02640c8d020100740074016a0219007c0218007d04740d740a6a0b8300740e6a0b8300640d640e640f8d047d057c056a0b83009001731c740f640d640e64108d027d057c056a107411830101007c036a0c74047c0483017c056a0b8300640c8d0201006401740074016a023c0064116a1274047c0283017c008302530029124e72010000007a17596f7520617265206e6f742073756273637269626564217226000000e91e0000002901da0464617973e964000000e95a000000e932000000e978000000e946000000e9500000002902722300000072240000007202000000da057661756c74290472210000007222000000720500000072060000002902720500000072060000007a1c5061796564206f7574207b7d204e45422066726f6d207b7d204e454229137231000000722e00000072300000007228000000722a0000007232000000da086461746574696d65da0974696d6564656c7461722b000000722c000000721b0000007227000000da087472616e73666572da0f466f726569676e5661726961626c65721c000000da085661726961626c657217000000da0e494e5445524e414c5f5641554c54da06666f726d61742906da0c746f74616c5f616d6f756e74da0a74696d655f64656c7461da067061796f75747235000000da0c616d6f756e745f64656c7461da075f5f7661756c74721d000000721d000000721e000000da0b756e73756273637269626524000000732c000000000216010e01120110011401100114011001140212010e0114010e010801080108010a010c010a0116010a01724c000000630000000000000000000000000200000043000000731400000074008300010074016a026401830101006400530029024e542903da0e5f5f6173736572745f6f776e657272160000007217000000721d000000721d000000721d000000721e000000da06656e61626c653f000000730400000000020601724e000000630000000000000000000000000200000043000000731400000074008300010074016a026401830101006400530029024e462903724d00000072160000007217000000721d000000721d000000721d000000721e000000da0764697361626c6545000000730400000000020601724f0000002901722300000063010000000000000001000000020000004300000073240000007400830001007c0064016b057316740164028301820174026a037c00830101006400530029034e72010000007a21416d6f756e74206f66205441552063616e206e6f74206265206e656761746976652904724d00000072280000007218000000721700000029017223000000721d000000721d000000721e000000da0e7365745f7461755f616d6f756e744b0000007306000000000206011001725000000029027205000000da087661726961626c65630200000000000000020000000200000043000000731e00000074008300010074016a027c008301010074036a027c01830101006400530029014e2904724d00000072190000007217000000721a000000290272050000007251000000721d000000721d000000721e000000da137365745f70726963655f696e74657266616365520000007306000000000206010a017252000000630200000000000000020000000200000043000000731e00000074008300010074016a027c008301010074036a027c01830101006400530029014e2904724d000000721b0000007217000000721c000000290272050000007251000000721d000000721d000000721e000000da137365745f7661756c745f696e74657266616365590000007306000000000206010a017253000000630000000000000000000000000200000043000000731600000074006a0174026b06731274036401830182016400530029024e7a1d4f6e6c792065786563757461626c65206279206f70657261746f7273212904722e0000007230000000da094f50455241544f52537228000000721d000000721d000000721d000000721e000000724d0000006000000073020000000001724d0000004e2918da044861736872310000007244000000721600000072180000007219000000721a000000721b000000721c0000007245000000da0c4255524e5f414444524553537254000000721f000000da085f5f6578706f72747236000000724c000000724e000000724f000000722a0000007250000000da0373747272520000007253000000724d000000721d000000721d000000721d000000721e000000da083c6d6f64756c653e01000000732c0000000e010c010c010c010c010c010c0104010401020106030809100d101b10061006060110060601120606011206
 
Contract con_ape_test005
Variable __owner__
New Value null
 
Contract con_ape_test005
Variable __submitted__
New Value 2021,9,2,0,40,40,0
 
Contract con_ape_test005
Variable __developer__
New Value ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
 
Contract currency
Variable balances
Key ae7d14d6d9b8443f881ba6244727b69b681010e782d4fe482dbfb0b6aca02d5d
New Value 2285.783992249853638379165310932452