Contract con_autocollide


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 @export
7 def run_collide(times: int, amount: float):
8 currency.transfer_from(amount=amount*times, to=ctx.this, main_account=ctx.caller)
9
10 for x in range(times):
11 result = collider.collide(amount=amount)
12 if 'won' in result:
13 rswp.sell(contract='con_collider_contract', token_amount=token.balance_of(ctx.this) * 0.9)
14
15 token.transfer(amount=token.balance_of(ctx.this), to=ctx.caller)
16 currency.transfer(amount=currency.balance_of(ctx.this), to=ctx.caller)

Byte Code

e30000000000000000000000000400000040000000733c000000640064016c005a01640064016c025a03640064016c045a05640064016c065a066507640283016508650964039c0264046405840483015a0a640153002906e9000000004eda0f636f6e5f6175746f636f6c6c6964652902da0574696d6573da06616d6f756e74630200000000000000040000000600000043000000739000000074006a017c017c00140074026a0374026a0464018d030100784274057c00830144005d367d0274066a077c0164028d017d0364037c036b06722274086a096404740a6a0b74026a038301740c64058301140064068d02010071225700740a6a0d740a6a0b74026a03830174026a0464078d02010074006a0d74006a0b74026a03830174026a0464078d0201006400530029084e29037204000000da02746fda0c6d61696e5f6163636f756e7429017204000000da03776f6eda15636f6e5f636f6c6c696465725f636f6e74726163747a03302e392902da08636f6e7472616374da0c746f6b656e5f616d6f756e74290272040000007205000000290eda0863757272656e6379da0d7472616e736665725f66726f6dda03637478da0474686973da0663616c6c6572da0572616e6765da08636f6c6c69646572da07636f6c6c696465da0472737770da0473656c6cda05746f6b656eda0a62616c616e63655f6f66da07646563696d616cda087472616e73666572290472030000007204000000da0178da06726573756c74a900721b000000da00da0b72756e5f636f6c6c69646507000000731200000000020e010a010e010c0108010a0118011801721d000000290bda10636f6e5f636f6c6c696465725f303037721100000072080000007215000000da1c636f6e5f726f636b6574737761705f6f6666696369616c5f76315f317213000000720b000000da085f5f6578706f7274da03696e74da05666c6f6174721d000000721b000000721b000000721b000000721c000000da083c6d6f64756c653e01000000730a00000008010801080108030601