Contract con_autocollide_6
Creator | 4a035ff604ffb0a44e5235e2fed8f69666b6df6ff11cbfa347d154d1a5453bba |
Creation Hash | 0facc45f8f33cfc9148ecde204e05d3cfb2a7bc254d2301fbb61311dc8350130 |
Created On | 1026 days ago - 7/2/2021, 7:57:41 PM UTC+0 |
Contract Code
1
import con_collider_007 as collider
2
import con_collider_contract as token
3
import con_rocketswap_official_v1_1 as rswp
4
import currency
5
6
balances_alt = ForeignHash(foreign_contract='con_collider_contract', foreign_name='balances')
7
8
@export
9
def run_collide(times: int, amount: float):
10
currency.approve(amount=1000000, to='con_collider_007')
11
token.approve(amount=1000000, to='con_rocketswap_official_v1_1')
12
13
currency.transfer_from(amount=amount*times, to=ctx.this, main_account=ctx.caller)
14
15
for x in range(times):
16
result = collider.collide(amount=amount)
17
if 'won' in result:
18
rswp.sell(contract='con_collider_contract', token_amount=balances_alt[ctx.this] * 0.9)
19
20
# token.transfer(amount=balances_alt[ctx.this], to=ctx.caller)
21
currency.transfer(amount=currency.balance_of(ctx.this), to=ctx.caller)
22
23
@export
24
def return_collider(amount: float):
25
currency.transfer(amount=amount, to=ctx.caller)
Byte Code
e300000000000000000000000006000000400000007362000000640064016c005a01640064016c025a03640064016c045a05640064016c065a066507640264036404640564068d045a08650964048301650a650b64079c0264086409840483015a0c650964048301650b640a9c01640b640c840483015a0d64015300290de9000000004eda15636f6e5f636f6c6c696465725f636f6e7472616374da0862616c616e636573da11636f6e5f6175746f636f6c6c6964655f36da0c62616c616e6365735f616c742904da10666f726569676e5f636f6e7472616374da0c666f726569676e5f6e616d65da08636f6e7472616374da046e616d652902da0574696d6573da06616d6f756e74630200000000000000040000000600000043000000739200000074006a016401640264038d02010074026a016401640464038d02010074006a037c017c00140074046a0574046a0664058d030100784074077c00830144005d347d0274086a097c0164068d017d0364077c036b06723e740a6a0b6408740c74046a051900740d640983011400640a8d020100713e570074006a0e74006a0f74046a05830174046a0664038d02010064005300290b4e6940420f00da10636f6e5f636f6c6c696465725f3030372902720b000000da02746fda1c636f6e5f726f636b6574737761705f6f6666696369616c5f76315f312903720b000000720d000000da0c6d61696e5f6163636f756e742901720b000000da03776f6e72020000007a03302e3929027208000000da0c746f6b656e5f616d6f756e742910da0863757272656e6379da07617070726f7665da05746f6b656eda0d7472616e736665725f66726f6dda03637478da0474686973da0663616c6c6572da0572616e6765da08636f6c6c69646572da07636f6c6c696465da0472737770da0473656c6cda0e5f5f62616c616e6365735f616c74da07646563696d616cda087472616e73666572da0a62616c616e63655f6f662904720a000000720b000000da0178da06726573756c74a9007224000000da00da0b72756e5f636f6c6c69646509000000731400000000020e010e010e010a010e010c01080106011a0172260000002901720b000000630100000000000000010000000400000043000000731400000074006a017c0074026a0364018d0201006400530029024e2902720b000000720d000000290472120000007220000000721600000072180000002901720b000000722400000072240000007225000000da0f72657475726e5f636f6c6c6964657217000000730200000000027227000000290e720c000000721a00000072020000007214000000720e000000721c0000007212000000da0b466f726569676e48617368721e000000da085f5f6578706f7274da03696e74da05666c6f6174722600000072270000007224000000722400000072240000007225000000da083c6d6f64756c653e010000007312000000080108010801080104010c030601120d0601