Transaction #129974

Hash 85a2e9543c0a78b119f4d814ea2adb09fcca594c628b64e03ff86c7010d5614b
Status Success
Timestamp 75 days ago - 7/11/2021, 8:07:31 PM UTC+0
Block 127220
Stamps Used 1318
Burned Fee 0.20276923 TAU
From 7c296eb80e379171f694a3c5be7640d16f300f09d731c99ac0a92f49c9c0c151 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 243
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 2b74cba2ef28938dd2e55680d35331af959d3b252fee95576cd7c68ce99655e74ecfef46f8c18be70db1373c8efe3e71783ed37baa0289e5066f1ad7c7f4f50d
Stamps Supplied 3250
Stamps per TAU 65

Kwargs

code # Imports import con_rswp_lst001 I = importlib # Setup Tokens STAKING_TOKEN = con_rswp_lst001 YIELD_TOKEN = con_rswp_lst001 # State Owner = Variable() DevRewardWallet = Variable() EmissionRatePerHour = Variable() DevRewardPct = Variable() StartTime = Variable() EndTime = Variable() OpenForBusiness = Variable() # If false, users will be unable to join the pool Deposits = Hash(default_value=False) Withdrawals = Hash(default_value=0) CurrentEpochIndex = Variable() Epochs = Hash(default_value=False) StakedBalance = Variable() # The total amount of farming token in the vault. WithdrawnBalance = Variable() EpochMinTime = Variable() # The minimum amount of seconds in Epoch EpochMaxRatioIncrease = ( Variable() ) # The maximum ratio which the Epoch can increase by since last Epoch before incrementing. meta = Hash(default_value=False) decimal_converter_var = Variable() TimeRampValues = Variable() UseTimeRamp = Variable() TrustedExporters = Variable() # Vtoken balances = Hash(default_value=0) @construct def seed(): Owner.set(ctx.caller) DevRewardWallet.set(ctx.caller) CurrentEpochIndex.set(0) StakedBalance.set(0) WithdrawnBalance.set(0) EpochMaxRatioIncrease.set(1 / 2) EpochMinTime.set(0) UseTimeRamp.set(True) TrustedExporters.set([]) TimeRampValues.set( [ {"lower": 0, "upper": 1, "multiplier": 0.1}, {"lower": 1, "upper": 2, "multiplier": 0.2}, {"lower": 2, "upper": 3, "multiplier": 0.3}, {"lower": 3, "upper": 4, "multiplier": 0.4}, {"lower": 4, "upper": 5, "multiplier": 0.5}, {"lower": 5, "upper": 6, "multiplier": 0.6}, {"lower": 6, "upper": 7, "multiplier": 0.7}, {"lower": 7, "upper": 8, "multiplier": 0.8}, {"lower": 8, "upper": 9, "multiplier": 0.9}, {"lower": 9, "upper": 10, "multiplier": 1}, ] ) Epochs[0] = {"time": now, "staked": 0, "amt_per_hr": 2629} meta["version"] = "0.0.2" meta[ "type" ] = "staking_smart_epoch_compounding_timeramp" # staking || lp_farming || etcetera ... meta["STAKING_TOKEN"] = "con_rswp_lst001" meta["YIELD_TOKEN"] = "con_rswp_lst001" EmissionRatePerHour.set(2629) # 1200000 RSWP per year = 10% of supply DevRewardPct.set(1 / 10) # The datetime from which you want to allow staking. StartTime.set(datetime.datetime(year=2021, month=7, day=12, hour=0)) # The datetime at which you want staking to finish. EndTime.set(datetime.datetime(year=2022, month=5, day=4, hour=0)) OpenForBusiness.set(True) @export def addStakingTokens(amount: float): user = ctx.caller deposit = Deposits[user] if deposit is False: return createNewDeposit(amount=amount, user_ctx="caller", from_contract=False) else: return increaseDeposit(amount=amount, user_ctx="caller", from_contract=False) # This is called FROM the contract to which the yields will be staked. # This contract name will need to be added to the "TrustedImporters" list on the foreign contract. @export def stakeFromContractProfits(contract: str): # verify that the contract is calling it is trusted. assert ( contract in TrustedExporters.get() ), "The contract is not in the trusted exporters list." # import staking contract yield_contract = I.import_module(contract) # call withdraw function to this contract, take return value amount = yield_contract.exportYieldToForeignContract() # stake this value user = ctx.signer deposit = Deposits[user] if deposit is False: return createNewDeposit(amount=amount, user_ctx="caller", from_contract=True) else: return increaseDeposit(amount=amount, user_ctx="caller", from_contract=True) def createNewDeposit( amount: float, user_ctx: str, from_contract: bool ): # user_ctx will either be "caller" or "signer" assert OpenForBusiness.get() == True, "This staking pool is not open right now." assert amount > 0, "You must stake something." user = ctx.caller # Take the staking tokens from the user's wallet if the user has called this function via addStakingTokens if from_contract is False: STAKING_TOKEN.transfer_from(amount=amount, to=ctx.this, main_account=user) # Update the Staked amount staked = StakedBalance.get() new_staked_amount = staked + amount StakedBalance.set(new_staked_amount) # Update the Epoch epoch_index = decideIncrementEpoch(new_staked_amount=new_staked_amount) # Create a record of the user's deposit Deposits[user] = {"starting_epoch": epoch_index, "time": now, "amount": amount} # mint vtoken equal to the deposit. mintVToken(amount=amount) return Deposits[user] def increaseDeposit( amount: float, user_ctx: str, from_contract: bool ): # user_ctx will either be "caller" or "signer" user = ctx.caller if user_ctx is "caller" else ctx.signer assert OpenForBusiness.get() == True, "This staking pool is not open right now." assert amount >= 0, "You cannot stake a negative balance." deposit = Deposits[user] assert deposit is not False, "This user has no deposit to add to." # Take the staking tokens from the user's wallet if amount > 0 and from_contract is False: STAKING_TOKEN.transfer_from(amount=amount, to=ctx.this, main_account=user) withdrawn_yield = Withdrawals[user] yield_to_harvest = 0 existing_stake = 0 user_yield_share = 0 yield_to_harvest += calculateYield(deposit=deposit) deposit_start_time = deposit["time"] existing_stake = deposit["amount"] yield_to_harvest -= withdrawn_yield if yield_to_harvest > 0: # Take % of Yield Tokens, send it to dev fund dev_share = yield_to_harvest * DevRewardPct.get() if dev_share > 0: YIELD_TOKEN.transfer(to=DevRewardWallet.get(), amount=dev_share) # Send remanding Yield Tokens to user user_yield_share = yield_to_harvest - dev_share total_deposit_amount = user_yield_share + existing_stake + amount global_amount_staked = StakedBalance.get() new_global_staked = global_amount_staked + user_yield_share + amount StakedBalance.set(new_global_staked) WithdrawnBalance.set(WithdrawnBalance.get() + yield_to_harvest) mintVToken(amount=user_yield_share + amount) Withdrawals[user] = 0 Deposits[user] = { "starting_epoch": decideIncrementEpoch(new_staked_amount=new_global_staked), "time": deposit_start_time, "amount": total_deposit_amount, "step_offset": fitTimeToRange(now) - fitTimeToRange(deposit_start_time), } return Deposits[user] def sendYieldToTarget(amount: float, target: str, user: str): deposit = Deposits[user] assert deposit is not False, "You have no deposit to withdraw yield from." # Calculate how much yield is due per deposit account withdrawn_yield = Withdrawals[user] harvestable_yield = 0 harvestable_yield += calculateYield(deposit=deposit) # Determine maximum amount of yield user can withdraw harvestable_yield -= withdrawn_yield yield_to_harvest = amount if amount < harvestable_yield else harvestable_yield assert yield_to_harvest > 0, "There is no yield to harvest right now :(" # Take % of Yield Tokens, send it to dev fund dev_share = yield_to_harvest * DevRewardPct.get() if dev_share > 0: YIELD_TOKEN.transfer(to=DevRewardWallet.get(), amount=dev_share) # Send remanding Yield Tokens to user user_share = yield_to_harvest - dev_share YIELD_TOKEN.transfer(to=target, amount=user_share) Withdrawals[user] = withdrawn_yield + yield_to_harvest new_withdrawn_amount = WithdrawnBalance.get() + yield_to_harvest WithdrawnBalance.set(new_withdrawn_amount) return user_share @export def withdrawYield(amount: float): assert amount > 0, "You cannot harvest a negative balance" user = ctx.caller return sendYieldToTarget(amount=amount, target=user, user=user) @export def withdrawTokensAndYield(): user = ctx.caller deposit = Deposits[user] assert deposit is not False, "You have no deposit to withdraw" # Calculate how much yield is due per deposit account withdrawn_yield = Withdrawals[user] stake_to_return = 0 yield_to_harvest = 0 user_share = 0 yield_to_harvest += calculateYield(deposit=deposit) stake_to_return += deposit["amount"] # Send Staking Tokens to user STAKING_TOKEN.transfer(to=user, amount=stake_to_return) returnAndBurnVToken(amount=stake_to_return) # check that the user has yield left to harvest (this should never be negative, but let's check here just in case) yield_to_harvest -= withdrawn_yield if yield_to_harvest > 0: # Take % of Yield Tokens, send it to dev fund dev_share = yield_to_harvest * DevRewardPct.get() if dev_share > 0: YIELD_TOKEN.transfer(to=DevRewardWallet.get(), amount=dev_share) # Send remanding Yield Tokens to user user_share = yield_to_harvest - dev_share YIELD_TOKEN.transfer(to=user, amount=user_share) # Reset User's Deposits Deposits[user] = False # Reset User's Withdrawal Withdrawals[user] = 0 # Remove token amount from Staked new_staked_amount = StakedBalance.get() - stake_to_return StakedBalance.set(new_staked_amount) new_withdrawn_amount = WithdrawnBalance.get() + yield_to_harvest WithdrawnBalance.set(new_withdrawn_amount) # Increment Epoch decideIncrementEpoch(new_staked_amount=new_staked_amount) return user_share # This runs over each of the items in the user's Deposit def calculateYield(deposit): starting_epoch_index = deposit.get("starting_epoch") deposit_start_time = deposit.get("time") amount = deposit.get("amount") step_offset = deposit.get("step_offset") if step_offset is not None: deposit_start_time = deposit_start_time + step_offset else: step_offset = now - now # now - now // 0 delta current_epoch_index = getCurrentEpochIndex() this_epoch_index = starting_epoch_index y = 0 time_step_multiplier = 1 while this_epoch_index <= current_epoch_index: this_epoch = Epochs[this_epoch_index] next_epoch = Epochs[this_epoch_index + 1] if UseTimeRamp.get(): time_ramp_delta = ( fitTimeToRange(now) - fitTimeToRange(this_epoch["time"]) + step_offset ) time_step_multiplier = findTimeRampStep(time_ramp_delta.days) delta = 0 if starting_epoch_index == current_epoch_index: delta = fitTimeToRange(now) - fitTimeToRange(deposit_start_time) elif this_epoch_index == starting_epoch_index: delta = fitTimeToRange(next_epoch["time"]) - fitTimeToRange( deposit_start_time ) elif this_epoch_index == current_epoch_index: delta = fitTimeToRange(now) - fitTimeToRange(this_epoch["time"]) else: delta = fitTimeToRange(next_epoch["time"]) - fitTimeToRange( this_epoch["time"] ) pct_share_of_stake = 0 if amount is not 0 and this_epoch["staked"] is not 0: pct_share_of_stake = amount / this_epoch["staked"] # These two lines below were causing some problems, until I used the decimal method. get a python expert to review. emission_rate_per_hour = this_epoch["amt_per_hr"] global_yield_this_epoch = delta.seconds * getEmissionRatePerSecond( emission_rate_per_hour ) decimal_converter_var.set(pct_share_of_stake) pct_share_of_stake = decimal_converter_var.get() deposit_yield_this_epoch = ( global_yield_this_epoch * pct_share_of_stake * time_step_multiplier ) y += deposit_yield_this_epoch this_epoch_index += 1 return y def fitTimeToRange(time: Any): if time < StartTime.get(): time = StartTime.get() elif time > EndTime.get(): time = EndTime.get() return time def getCurrentEpochIndex(): current_epoch_index = CurrentEpochIndex.get() return current_epoch_index def decideIncrementEpoch(new_staked_amount: float): epoch_index = getCurrentEpochIndex() this_epoch = Epochs[epoch_index] this_epoch_staked = this_epoch["staked"] delta = now - this_epoch["time"] delta_seconds = delta.seconds if delta.seconds > 0 else 0 if ( delta_seconds >= EpochMinTime.get() or this_epoch_staked is 0 or maxStakedChangeRatioExceeded( new_staked_amount=new_staked_amount, this_epoch_staked=this_epoch_staked ) ): epoch_index = incrementEpoch(new_staked_amount) return epoch_index def maxStakedChangeRatioExceeded(new_staked_amount: float, this_epoch_staked: float): smaller = ( new_staked_amount if new_staked_amount <= this_epoch_staked else this_epoch_staked ) bigger = ( new_staked_amount if new_staked_amount >= this_epoch_staked else this_epoch_staked ) dif = bigger - smaller if this_epoch_staked < 0.0001: return true return (dif) / this_epoch_staked >= EpochMaxRatioIncrease.get() def incrementEpoch(new_staked_amount: float): current_epoch = CurrentEpochIndex.get() new_epoch_idx = current_epoch + 1 CurrentEpochIndex.set(new_epoch_idx) Epochs[new_epoch_idx] = { "time": now, "staked": new_staked_amount, "amt_per_hr": Epochs[current_epoch]["amt_per_hr"], } return new_epoch_idx @export def changeAmountPerHour(amount_per_hour: float): assertOwner() current_epoch = getCurrentEpochIndex() new_epoch_idx = current_epoch + 1 CurrentEpochIndex.set(new_epoch_idx) setEmissionRatePerHour(amount=amount_per_hour) Epochs[new_epoch_idx] = { "time": now, "staked": StakedBalance.get(), "amt_per_hr": amount_per_hour, } @export def setEpochMinTime(min_seconds: float): assertOwner() assert min_seconds >= 0, "you must choose a positive value." EpochMinTime.set(min_seconds) @export def setEpochMaxRatioIncrease(ratio: float): assertOwner() assert ratio > 0, "must be a positive value" EpochMaxRatioIncrease.set(ratio) def getEmissionRatePerSecond(emission_rate_per_hour: float): emission_rate_per_minute = emission_rate_per_hour / 60 emission_rate_per_second = emission_rate_per_minute / 60 return emission_rate_per_second @export def setOwner(vk: str): assertOwner() Owner.set(vk) @export def setDevWallet(vk: str): assertOwner() DevRewardWallet.set(vk) @export def setDevRewardPct(amount: float): assertOwner() assert amount < 1 and amount >= 0, "Amount must be a value between 0 and 1" DevRewardPct.set(amount) def setEmissionRatePerHour(amount: float): assertOwner() EmissionRatePerHour.set(amount) @export def addToTrustedExporters(contract: str): assertOwner() trusted_exporters = TrustedExporters.get() if contract in trusted_exporters: return trusted_exporters.append(contract) TrustedExporters.set(trusted_exporters) @export def removeFromTrustedExporters(contract: str): assertOwner() trusted_exporters = TrustedExporters.get() trusted_exporters.remove(contract) TrustedExporters.set(trusted_exporters) @export def recoverYieldToken(): assertOwner() staked_balance = StakedBalance.get() yield_balances = ForeignHash( foreign_contract=meta["YIELD_TOKEN"], foreign_name="balances" ) total_in_contract = yield_balances[ctx.this] total_available = total_in_contract - staked_balance YIELD_TOKEN.transfer(amount=total_available, to=Owner.get()) @export def allowStaking(is_open: bool): assertOwner() OpenForBusiness.set(is_open) @export def setStartTime(year: int, month: int, day: int, hour: int): assertOwner() time = datetime.datetime(year, month, day, hour) StartTime.set(time) @export def setEndTime(year: int, month: int, day: int, hour: int): assertOwner() time = datetime.datetime(year, month, day, hour) EndTime.set(time) def assertOwner(): assert Owner.get() == ctx.caller, "You must be the owner to call this function." # This is only to be called in emergencies - the user will forgo their yield when calling this FN. @export def emergencyReturnStake(): user = ctx.caller deposit = Deposits[user] assert Deposits[user] is not False, "This account has no deposits to return." stake_to_return = 0 stake_to_return += deposit["amount"] STAKING_TOKEN.transfer(to=user, amount=stake_to_return) returnAndBurnVToken(amount=stake_to_return) Deposits[user] = False Withdrawals[user] = 0 # Remove token amount from Staked new_staked_amount = StakedBalance.get() - stake_to_return StakedBalance.set(new_staked_amount) decideIncrementEpoch(new_staked_amount=new_staked_amount) @export def toggleTimeRamp(on: bool): assertOwner() UseTimeRamp.set(on) def findTimeRampStep(days: int): time_ramps = TimeRampValues.get() step = None for s in time_ramps: if s["lower"] <= days and s["upper"] > days: step = s if step is None: return time_ramps[len(time_ramps) - 1]["multiplier"] return step["multiplier"] @export def setTimeRampValues(data: list): assertOwner() TimeRampValues.set(data) # VTOKEN METHODS @export def transfer(amount: float, to: str): assert amount > 0, "Cannot send negative balances!" assert balances[ctx.caller] >= amount, "Not enough VTOKENS to send!" balances[ctx.caller] -= amount balances[to] += amount @export def approve(amount: float, to: str): assert amount > 0, "Cannot send negative balances!" balances[ctx.caller, to] += amount @export def transfer_from(amount: float, to: str, main_account: str): assert amount > 0, "Cannot send negative balances!" assert ( balances[main_account, ctx.caller] >= amount ), "Not enough coins approved to send! You have {} and are trying to spend {}".format( balances[main_account, ctx.caller], amount ) assert balances[main_account] >= amount, "Not enough coins to send!" balances[main_account, ctx.caller] -= amount balances[main_account] -= amount balances[to] += amount def returnAndBurnVToken(amount: float): user = ctx.caller assert ( balances[user] >= amount ), "Your VTOKEN balance is too low to unstake, recover your VTOKENS and try again." balances[user] -= amount def mintVToken(amount: float): user = ctx.signer balances[user] += amount
name con_staking_rswp_interop

State Changes

Contract con_staking_rswp_interop
Variable Owner
New Value 7c296eb80e379171f694a3c5be7640d16f300f09d731c99ac0a92f49c9c0c151
 
Contract con_staking_rswp_interop
Variable DevRewardWallet
New Value 7c296eb80e379171f694a3c5be7640d16f300f09d731c99ac0a92f49c9c0c151
 
Contract con_staking_rswp_interop
Variable CurrentEpochIndex
New Value 0
 
Contract con_staking_rswp_interop
Variable StakedBalance
New Value 0
 
Contract con_staking_rswp_interop
Variable WithdrawnBalance
New Value 0
 
Contract con_staking_rswp_interop
Variable EpochMaxRatioIncrease
New Value 0.5
 
Contract con_staking_rswp_interop
Variable EpochMinTime
New Value 0
 
Contract con_staking_rswp_interop
Variable UseTimeRamp
New Value true
 
Contract con_staking_rswp_interop
Variable TrustedExporters
New Value
 
Contract con_staking_rswp_interop
Variable TimeRampValues
New Value
 
Contract con_staking_rswp_interop
Variable Epochs
Key 0
New Value
 
Contract con_staking_rswp_interop
Variable meta
Key version
New Value 0.0.2
 
Contract con_staking_rswp_interop
Variable meta
Key type
New Value staking_smart_epoch_compounding_timeramp
 
Contract con_staking_rswp_interop
Variable meta
Key STAKING_TOKEN
New Value con_rswp_lst001
 
Contract con_staking_rswp_interop
Variable meta
Key YIELD_TOKEN
New Value con_rswp_lst001
 
Contract con_staking_rswp_interop
Variable EmissionRatePerHour
New Value 2629
 
Contract con_staking_rswp_interop
Variable DevRewardPct
New Value 0.1
 
Contract con_staking_rswp_interop
Variable StartTime
New Value 2021,7,12,0,0,0,0
 
Contract con_staking_rswp_interop
Variable EndTime
New Value 2022,5,4,0,0,0,0
 
Contract con_staking_rswp_interop
Variable OpenForBusiness
New Value true
 
Contract con_staking_rswp_interop
Variable __code__
New Value import con_rswp_lst001 I = importlib STAKING_TOKEN = con_rswp_lst001 YIELD_TOKEN = con_rswp_lst001 __Owner = Variable(contract='con_staking_rswp_interop', name='Owner') __DevRewardWallet = Variable(contract='con_staking_rswp_interop', name= 'DevRewardWallet') __EmissionRatePerHour = Variable(contract='con_staking_rswp_interop', name= 'EmissionRatePerHour') __DevRewardPct = Variable(contract='con_staking_rswp_interop', name= 'DevRewardPct') __StartTime = Variable(contract='con_staking_rswp_interop', name='StartTime') __EndTime = Variable(contract='con_staking_rswp_interop', name='EndTime') __OpenForBusiness = Variable(contract='con_staking_rswp_interop', name= 'OpenForBusiness') __Deposits = Hash(default_value=False, contract='con_staking_rswp_interop', name='Deposits') __Withdrawals = Hash(default_value=0, contract='con_staking_rswp_interop', name='Withdrawals') __CurrentEpochIndex = Variable(contract='con_staking_rswp_interop', name= 'CurrentEpochIndex') __Epochs = Hash(default_value=False, contract='con_staking_rswp_interop', name='Epochs') __StakedBalance = Variable(contract='con_staking_rswp_interop', name= 'StakedBalance') __WithdrawnBalance = Variable(contract='con_staking_rswp_interop', name= 'WithdrawnBalance') __EpochMinTime = Variable(contract='con_staking_rswp_interop', name= 'EpochMinTime') __EpochMaxRatioIncrease = Variable(contract='con_staking_rswp_interop', name='EpochMaxRatioIncrease') __meta = Hash(default_value=False, contract='con_staking_rswp_interop', name='meta') __decimal_converter_var = Variable(contract='con_staking_rswp_interop', name='decimal_converter_var') __TimeRampValues = Variable(contract='con_staking_rswp_interop', name= 'TimeRampValues') __UseTimeRamp = Variable(contract='con_staking_rswp_interop', name= 'UseTimeRamp') __TrustedExporters = Variable(contract='con_staking_rswp_interop', name= 'TrustedExporters') __balances = Hash(default_value=0, contract='con_staking_rswp_interop', name='balances') def ____(): __Owner.set(ctx.caller) __DevRewardWallet.set(ctx.caller) __CurrentEpochIndex.set(0) __StakedBalance.set(0) __WithdrawnBalance.set(0) __EpochMaxRatioIncrease.set(1 / 2) __EpochMinTime.set(0) __UseTimeRamp.set(True) __TrustedExporters.set([]) __TimeRampValues.set([{'lower': 0, 'upper': 1, 'multiplier': decimal( '0.1')}, {'lower': 1, 'upper': 2, 'multiplier': decimal('0.2')}, { 'lower': 2, 'upper': 3, 'multiplier': decimal('0.3')}, {'lower': 3, 'upper': 4, 'multiplier': decimal('0.4')}, {'lower': 4, 'upper': 5, 'multiplier': decimal('0.5')}, {'lower': 5, 'upper': 6, 'multiplier': decimal('0.6')}, {'lower': 6, 'upper': 7, 'multiplier': decimal('0.7')}, {'lower': 7, 'upper': 8, 'multiplier': decimal('0.8')}, {'lower': 8, 'upper': 9, 'multiplier': decimal('0.9')}, {'lower': 9, 'upper': 10, 'multiplier': 1}]) __Epochs[0] = {'time': now, 'staked': 0, 'amt_per_hr': 2629} __meta['version'] = '0.0.2' __meta['type'] = 'staking_smart_epoch_compounding_timeramp' __meta['STAKING_TOKEN'] = 'con_rswp_lst001' __meta['YIELD_TOKEN'] = 'con_rswp_lst001' __EmissionRatePerHour.set(2629) __DevRewardPct.set(1 / 10) __StartTime.set(datetime.datetime(year=2021, month=7, day=12, hour=0)) __EndTime.set(datetime.datetime(year=2022, month=5, day=4, hour=0)) __OpenForBusiness.set(True) @__export('con_staking_rswp_interop') def addStakingTokens(amount: float): user = ctx.caller deposit = __Deposits[user] if deposit is False: return __createNewDeposit(amount=amount, user_ctx='caller', from_contract=False) else: return __increaseDeposit(amount=amount, user_ctx='caller', from_contract=False) @__export('con_staking_rswp_interop') def stakeFromContractProfits(contract: str): assert contract in __TrustedExporters.get( ), 'The contract is not in the trusted exporters list.' yield_contract = I.import_module(contract) amount = yield_contract.exportYieldToForeignContract() user = ctx.signer deposit = __Deposits[user] if deposit is False: return __createNewDeposit(amount=amount, user_ctx='caller', from_contract=True) else: return __increaseDeposit(amount=amount, user_ctx='caller', from_contract=True) def __createNewDeposit(amount: float, user_ctx: str, from_contract: bool): assert __OpenForBusiness.get( ) == True, 'This staking pool is not open right now.' assert amount > 0, 'You must stake something.' user = ctx.caller if from_contract is False: STAKING_TOKEN.transfer_from(amount=amount, to=ctx.this, main_account=user) staked = __StakedBalance.get() new_staked_amount = staked + amount __StakedBalance.set(new_staked_amount) epoch_index = __decideIncrementEpoch(new_staked_amount=new_staked_amount) __Deposits[user] = {'starting_epoch': epoch_index, 'time': now, 'amount': amount} __mintVToken(amount=amount) return __Deposits[user] def __increaseDeposit(amount: float, user_ctx: str, from_contract: bool): user = ctx.caller if user_ctx is 'caller' else ctx.signer assert __OpenForBusiness.get( ) == True, 'This staking pool is not open right now.' assert amount >= 0, 'You cannot stake a negative balance.' deposit = __Deposits[user] assert deposit is not False, 'This user has no deposit to add to.' if amount > 0 and from_contract is False: STAKING_TOKEN.transfer_from(amount=amount, to=ctx.this, main_account=user) withdrawn_yield = __Withdrawals[user] yield_to_harvest = 0 existing_stake = 0 user_yield_share = 0 yield_to_harvest += __calculateYield(deposit=deposit) deposit_start_time = deposit['time'] existing_stake = deposit['amount'] yield_to_harvest -= withdrawn_yield if yield_to_harvest > 0: dev_share = yield_to_harvest * __DevRewardPct.get() if dev_share > 0: YIELD_TOKEN.transfer(to=__DevRewardWallet.get(), amount=dev_share) user_yield_share = yield_to_harvest - dev_share total_deposit_amount = user_yield_share + existing_stake + amount global_amount_staked = __StakedBalance.get() new_global_staked = global_amount_staked + user_yield_share + amount __StakedBalance.set(new_global_staked) __WithdrawnBalance.set(__WithdrawnBalance.get() + yield_to_harvest) __mintVToken(amount=user_yield_share + amount) __Withdrawals[user] = 0 __Deposits[user] = {'starting_epoch': __decideIncrementEpoch( new_staked_amount=new_global_staked), 'time': deposit_start_time, 'amount': total_deposit_amount, 'step_offset': __fitTimeToRange(now ) - __fitTimeToRange(deposit_start_time)} return __Deposits[user] def __sendYieldToTarget(amount: float, target: str, user: str): deposit = __Deposits[user] assert deposit is not False, 'You have no deposit to withdraw yield from.' withdrawn_yield = __Withdrawals[user] harvestable_yield = 0 harvestable_yield += __calculateYield(deposit=deposit) harvestable_yield -= withdrawn_yield yield_to_harvest = (amount if amount < harvestable_yield else harvestable_yield) assert yield_to_harvest > 0, 'There is no yield to harvest right now :(' dev_share = yield_to_harvest * __DevRewardPct.get() if dev_share > 0: YIELD_TOKEN.transfer(to=__DevRewardWallet.get(), amount=dev_share) user_share = yield_to_harvest - dev_share YIELD_TOKEN.transfer(to=target, amount=user_share) __Withdrawals[user] = withdrawn_yield + yield_to_harvest new_withdrawn_amount = __WithdrawnBalance.get() + yield_to_harvest __WithdrawnBalance.set(new_withdrawn_amount) return user_share @__export('con_staking_rswp_interop') def withdrawYield(amount: float): assert amount > 0, 'You cannot harvest a negative balance' user = ctx.caller return __sendYieldToTarget(amount=amount, target=user, user=user) @__export('con_staking_rswp_interop') def withdrawTokensAndYield(): user = ctx.caller deposit = __Deposits[user] assert deposit is not False, 'You have no deposit to withdraw' withdrawn_yield = __Withdrawals[user] stake_to_return = 0 yield_to_harvest = 0 user_share = 0 yield_to_harvest += __calculateYield(deposit=deposit) stake_to_return += deposit['amount'] STAKING_TOKEN.transfer(to=user, amount=stake_to_return) __returnAndBurnVToken(amount=stake_to_return) yield_to_harvest -= withdrawn_yield if yield_to_harvest > 0: dev_share = yield_to_harvest * __DevRewardPct.get() if dev_share > 0: YIELD_TOKEN.transfer(to=__DevRewardWallet.get(), amount=dev_share) user_share = yield_to_harvest - dev_share YIELD_TOKEN.transfer(to=user, amount=user_share) __Deposits[user] = False __Withdrawals[user] = 0 new_staked_amount = __StakedBalance.get() - stake_to_return __StakedBalance.set(new_staked_amount) new_withdrawn_amount = __WithdrawnBalance.get() + yield_to_harvest __WithdrawnBalance.set(new_withdrawn_amount) __decideIncrementEpoch(new_staked_amount=new_staked_amount) return user_share def __calculateYield(deposit): starting_epoch_index = deposit.get('starting_epoch') deposit_start_time = deposit.get('time') amount = deposit.get('amount') step_offset = deposit.get('step_offset') if step_offset is not None: deposit_start_time = deposit_start_time + step_offset else: step_offset = now - now current_epoch_index = __getCurrentEpochIndex() this_epoch_index = starting_epoch_index y = 0 time_step_multiplier = 1 while this_epoch_index <= current_epoch_index: this_epoch = __Epochs[this_epoch_index] next_epoch = __Epochs[this_epoch_index + 1] if __UseTimeRamp.get(): time_ramp_delta = __fitTimeToRange(now) - __fitTimeToRange( this_epoch['time']) + step_offset time_step_multiplier = __findTimeRampStep(time_ramp_delta.days) delta = 0 if starting_epoch_index == current_epoch_index: delta = __fitTimeToRange(now) - __fitTimeToRange(deposit_start_time ) elif this_epoch_index == starting_epoch_index: delta = __fitTimeToRange(next_epoch['time']) - __fitTimeToRange( deposit_start_time) elif this_epoch_index == current_epoch_index: delta = __fitTimeToRange(now) - __fitTimeToRange(this_epoch['time'] ) else: delta = __fitTimeToRange(next_epoch['time']) - __fitTimeToRange( this_epoch['time']) pct_share_of_stake = 0 if amount is not 0 and this_epoch['staked'] is not 0: pct_share_of_stake = amount / this_epoch['staked'] emission_rate_per_hour = this_epoch['amt_per_hr'] global_yield_this_epoch = delta.seconds * __getEmissionRatePerSecond( emission_rate_per_hour) __decimal_converter_var.set(pct_share_of_stake) pct_share_of_stake = __decimal_converter_var.get() deposit_yield_this_epoch = (global_yield_this_epoch * pct_share_of_stake * time_step_multiplier) y += deposit_yield_this_epoch this_epoch_index += 1 return y def __fitTimeToRange(time: Any): if time < __StartTime.get(): time = __StartTime.get() elif time > __EndTime.get(): time = __EndTime.get() return time def __getCurrentEpochIndex(): current_epoch_index = __CurrentEpochIndex.get() return current_epoch_index def __decideIncrementEpoch(new_staked_amount: float): epoch_index = __getCurrentEpochIndex() this_epoch = __Epochs[epoch_index] this_epoch_staked = this_epoch['staked'] delta = now - this_epoch['time'] delta_seconds = delta.seconds if delta.seconds > 0 else 0 if delta_seconds >= __EpochMinTime.get( ) or this_epoch_staked is 0 or __maxStakedChangeRatioExceeded( new_staked_amount=new_staked_amount, this_epoch_staked= this_epoch_staked): epoch_index = __incrementEpoch(new_staked_amount) return epoch_index def __maxStakedChangeRatioExceeded(new_staked_amount: float, this_epoch_staked: float): smaller = (new_staked_amount if new_staked_amount <= this_epoch_staked else this_epoch_staked) bigger = (new_staked_amount if new_staked_amount >= this_epoch_staked else this_epoch_staked) dif = bigger - smaller if this_epoch_staked < decimal('0.0001'): return true return dif / this_epoch_staked >= __EpochMaxRatioIncrease.get() def __incrementEpoch(new_staked_amount: float): current_epoch = __CurrentEpochIndex.get() new_epoch_idx = current_epoch + 1 __CurrentEpochIndex.set(new_epoch_idx) __Epochs[new_epoch_idx] = {'time': now, 'staked': new_staked_amount, 'amt_per_hr': __Epochs[current_epoch]['amt_per_hr']} return new_epoch_idx @__export('con_staking_rswp_interop') def changeAmountPerHour(amount_per_hour: float): __assertOwner() current_epoch = __getCurrentEpochIndex() new_epoch_idx = current_epoch + 1 __CurrentEpochIndex.set(new_epoch_idx) __setEmissionRatePerHour(amount=amount_per_hour) __Epochs[new_epoch_idx] = {'time': now, 'staked': __StakedBalance.get(), 'amt_per_hr': amount_per_hour} @__export('con_staking_rswp_interop') def setEpochMinTime(min_seconds: float): __assertOwner() assert min_seconds >= 0, 'you must choose a positive value.' __EpochMinTime.set(min_seconds) @__export('con_staking_rswp_interop') def setEpochMaxRatioIncrease(ratio: float): __assertOwner() assert ratio > 0, 'must be a positive value' __EpochMaxRatioIncrease.set(ratio) def __getEmissionRatePerSecond(emission_rate_per_hour: float): emission_rate_per_minute = emission_rate_per_hour / 60 emission_rate_per_second = emission_rate_per_minute / 60 return emission_rate_per_second @__export('con_staking_rswp_interop') def setOwner(vk: str): __assertOwner() __Owner.set(vk) @__export('con_staking_rswp_interop') def setDevWallet(vk: str): __assertOwner() __DevRewardWallet.set(vk) @__export('con_staking_rswp_interop') def setDevRewardPct(amount: float): __assertOwner() assert amount < 1 and amount >= 0, 'Amount must be a value between 0 and 1' __DevRewardPct.set(amount) def __setEmissionRatePerHour(amount: float): __assertOwner() __EmissionRatePerHour.set(amount) @__export('con_staking_rswp_interop') def addToTrustedExporters(contract: str): __assertOwner() trusted_exporters = __TrustedExporters.get() if contract in trusted_exporters: return trusted_exporters.append(contract) __TrustedExporters.set(trusted_exporters) @__export('con_staking_rswp_interop') def removeFromTrustedExporters(contract: str): __assertOwner() trusted_exporters = __TrustedExporters.get() trusted_exporters.remove(contract) __TrustedExporters.set(trusted_exporters) @__export('con_staking_rswp_interop') def recoverYieldToken(): __assertOwner() staked_balance = __StakedBalance.get() __yield_balances = ForeignHash(foreign_contract=__meta['YIELD_TOKEN'], foreign_name='balances', contract='con_staking_rswp_interop', name= 'yield_balances') total_in_contract = __yield_balances[ctx.this] total_available = total_in_contract - staked_balance YIELD_TOKEN.transfer(amount=total_available, to=__Owner.get()) @__export('con_staking_rswp_interop') def allowStaking(is_open: bool): __assertOwner() __OpenForBusiness.set(is_open) @__export('con_staking_rswp_interop') def setStartTime(year: int, month: int, day: int, hour: int): __assertOwner() time = datetime.datetime(year, month, day, hour) __StartTime.set(time) @__export('con_staking_rswp_interop') def setEndTime(year: int, month: int, day: int, hour: int): __assertOwner() time = datetime.datetime(year, month, day, hour) __EndTime.set(time) def __assertOwner(): assert __Owner.get( ) == ctx.caller, 'You must be the owner to call this function.' @__export('con_staking_rswp_interop') def emergencyReturnStake(): user = ctx.caller deposit = __Deposits[user] assert __Deposits[user ] is not False, 'This account has no deposits to return.' stake_to_return = 0 stake_to_return += deposit['amount'] STAKING_TOKEN.transfer(to=user, amount=stake_to_return) __returnAndBurnVToken(amount=stake_to_return) __Deposits[user] = False __Withdrawals[user] = 0 new_staked_amount = __StakedBalance.get() - stake_to_return __StakedBalance.set(new_staked_amount) __decideIncrementEpoch(new_staked_amount=new_staked_amount) @__export('con_staking_rswp_interop') def toggleTimeRamp(on: bool): __assertOwner() __UseTimeRamp.set(on) def __findTimeRampStep(days: int): time_ramps = __TimeRampValues.get() step = None for s in time_ramps: if s['lower'] <= days and s['upper'] > days: step = s if step is None: return time_ramps[len(time_ramps) - 1]['multiplier'] return step['multiplier'] @__export('con_staking_rswp_interop') def setTimeRampValues(data: list): __assertOwner() __TimeRampValues.set(data) @__export('con_staking_rswp_interop') def transfer(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' assert __balances[ctx.caller] >= amount, 'Not enough VTOKENS to send!' __balances[ctx.caller] -= amount __balances[to] += amount @__export('con_staking_rswp_interop') def approve(amount: float, to: str): assert amount > 0, 'Cannot send negative balances!' __balances[ctx.caller, to] += amount @__export('con_staking_rswp_interop') def transfer_from(amount: float, to: str, main_account: str): assert amount > 0, 'Cannot send negative balances!' assert __balances[main_account, ctx.caller ] >= amount, 'Not enough coins approved to send! You have {} and are trying to spend {}'.format( __balances[main_account, ctx.caller], amount) assert __balances[main_account] >= amount, 'Not enough coins to send!' __balances[main_account, ctx.caller] -= amount __balances[main_account] -= amount __balances[to] += amount def __returnAndBurnVToken(amount: float): user = ctx.caller assert __balances[user ] >= amount, 'Your VTOKEN balance is too low to unstake, recover your VTOKENS and try again.' __balances[user] -= amount def __mintVToken(amount: float): user = ctx.signer __balances[user] += amount
 
Contract con_staking_rswp_interop
Variable __compiled__
New Value e3000000000000000000000000060000004000000073da030000640064016c005a0065015a0265005a0365005a0465056402640364048d025a0665056402640564048d025a0765056402640664048d025a0865056402640764048d025a0965056402640864048d025a0a65056402640964048d025a0b65056402640a64048d025a0c650d640b6402640c640d8d035a0e650d64006402640e640d8d035a0f65056402640f64048d025a10650d640b64026410640d8d035a1165056402641164048d025a1265056402641264048d025a1365056402641364048d025a1465056402641464048d025a15650d640b64026415640d8d035a1665056402641664048d025a1765056402641764048d025a1865056402641864048d025a1965056402641964048d025a1a650d64006402641a640d8d035a1b641b641c84005a1c651d64028301651e641d9c01641e641f840483015a1f651d64028301652064209c0164216422840483015a21651e6520652264239c036424642584045a23651e6520652264239c036426642784045a24651e6520652064289c036429642a84045a25651d64028301651e641d9c01642b642c840483015a26651d64028301642d642e840083015a27642f643084005a28652964319c016432643384045a2a6434643584005a2b651e64369c016437643884045a2c651e651e64399c02643a643b84045a2d651e64369c01643c643d84045a2e651d64028301651e643e9c01643f6440840483015a2f651d64028301651e64419c0164426443840483015a30651d64028301651e64449c0164456446840483015a31651e64479c016448644984045a32651d640283016520644a9c01644b644c840483015a33651d640283016520644a9c01644d644e840483015a34651d64028301651e641d9c01644f6450840483015a35651e641d9c016451645284045a36651d64028301652064209c0164536454840483015a37651d64028301652064209c0164556456840483015a38651d6402830164576458840083015a39651d64028301652264599c01645a645b840483015a3a651d64028301653b653b653b653b645c9c04645d645e840483015a3c651d64028301653b653b653b653b645c9c04645f6460840483015a3d6461646284005a3e651d6402830164636464840083015a3f651d64028301652264659c0164666467840483015a40653b64689c016469646a84045a41651d640283016542646b9c01646c646d840483015a43651d64028301651e6520646e9c02646f6470840483015a44651d64028301651e6520646e9c0264716472840483015a45651d64028301651e6520652064739c0364746475840483015a46651e641d9c016476647784045a47651e641d9c016478647984045a4864015300297ae9000000004eda18636f6e5f7374616b696e675f727377705f696e7465726f70da054f776e65722902da08636f6e7472616374da046e616d65da0f44657652657761726457616c6c6574da13456d697373696f6e52617465506572486f7572da0c446576526577617264506374da09537461727454696d65da07456e6454696d65da0f4f70656e466f72427573696e65737346da084465706f736974732903da0d64656661756c745f76616c756572040000007205000000da0b5769746864726177616c73da1143757272656e7445706f6368496e646578da0645706f636873da0d5374616b656442616c616e6365da1057697468647261776e42616c616e6365da0c45706f63684d696e54696d65da1545706f63684d6178526174696f496e637265617365da046d657461da15646563696d616c5f636f6e7665727465725f766172da0e54696d6552616d7056616c756573da0b55736554696d6552616d70da10547275737465644578706f7274657273da0862616c616e636573630000000000000000000000000e00000043000000737201000074006a0174026a038301010074046a0174026a038301010074056a0164018301010074066a0164018301010074076a0164018301010074086a0164248301010074096a01640183010100740a6a01640483010100740b6a01670083010100740c6a0164016402740d6405830164069c0364026403740d6407830164069c0364036408740d6409830164069c036408640a740d640b830164069c03640a640c740d640d830164069c03640c640e740d640f830164069c03640e6410740d6411830164069c0364106412740d6413830164069c0364126414740d6415830164069c0364146416640264069c03670a83010100740e6401641764189c03740f64013c0064197410641a3c00641b7410641c3c00641d7410641e3c00641d7410641f3c0074116a0164178301010074126a0164258301010074136a0174146a14642064106421640164228d048301010074156a0174146a146423640c640a640164228d048301010074166a016404830101006400530029264e7201000000e901000000e902000000547a03302e312903da056c6f776572da057570706572da0a6d756c7469706c6965727a03302e32e9030000007a03302e33e9040000007a03302e34e9050000007a03302e35e9060000007a03302e36e9070000007a03302e37e9080000007a03302e38e9090000007a03302e39e90a00000069450a00002903da0474696d65da067374616b6564da0a616d745f7065725f68727a05302e302e32da0776657273696f6eda287374616b696e675f736d6172745f65706f63685f636f6d706f756e64696e675f74696d6572616d70da0474797065da0f636f6e5f727377705f6c7374303031da0d5354414b494e475f544f4b454eda0b5949454c445f544f4b454e69e5070000e90c0000002904da0479656172da056d6f6e7468da03646179da04686f757269e607000067000000000000e03f679a9999999999b93f2917da075f5f4f776e6572da03736574da03637478da0663616c6c6572da115f5f44657652657761726457616c6c6574da135f5f43757272656e7445706f6368496e646578da0f5f5f5374616b656442616c616e6365da125f5f57697468647261776e42616c616e6365da175f5f45706f63684d6178526174696f496e637265617365da0e5f5f45706f63684d696e54696d65da0d5f5f55736554696d6552616d70da125f5f547275737465644578706f7274657273da105f5f54696d6552616d7056616c756573da07646563696d616cda036e6f77da085f5f45706f636873da065f5f6d657461da155f5f456d697373696f6e52617465506572486f7572da0e5f5f446576526577617264506374da0b5f5f537461727454696d65da086461746574696d65da095f5f456e6454696d65da115f5f4f70656e466f72427573696e657373a900724d000000724d000000da00da045f5f5f5f2e000000733a00000000010c010c010a010a010a010a010a010a010a010a011601100110010e010e010e010e010e010c01100108010801080108010a010a0118011801724f0000002901da06616d6f756e74630100000000000000030000000500000043000000733600000074006a017d0174027c0119007d027c0264016b08722474037c006402640164038d03530074047c006402640164038d0353006400530029044e46723900000029037250000000da08757365725f637478da0d66726f6d5f636f6e7472616374290572380000007239000000da0a5f5f4465706f73697473da125f5f6372656174654e65774465706f736974da115f5f696e6372656173654465706f73697429037250000000da0475736572da076465706f736974724d000000724d000000724e000000da106164645374616b696e67546f6b656e734e000000730e0000000002060108010801060108020601725800000029017204000000630100000000000000050000000500000043000000735c0000007c0074006a0183006b067314740264018301820174036a047c0083017d017c016a0583007d0274066a077d0374087c0319007d047c0464026b08724a74097c026403640464058d035300740a7c026403640464058d0353006400530029064e7a3254686520636f6e7472616374206973206e6f7420696e207468652074727573746564206578706f7274657273206c6973742e467239000000542903725000000072510000007252000000290b7241000000da03676574da0e417373657274696f6e4572726f72da0149da0d696d706f72745f6d6f64756c65da1c6578706f72745969656c64546f466f726569676e436f6e74726163747238000000da067369676e657272530000007254000000725500000029057204000000da0e7969656c645f636f6e7472616374725000000072560000007257000000724d000000724d000000724e000000da187374616b6546726f6d436f6e747261637450726f666974735a000000731600000000020e0106010a01080106010801080106010802060172600000002903725000000072510000007252000000630300000000000000070000000500000043000000738a00000074006a01830064016b02731474026402830182017c0064036b047324740264048301820174036a047d037c0264056b08724474056a067c0074036a077c0364068d03010074086a0183007d047c047c0017007d0574086a097c0583010100740a7c0564078d017d067c06740b7c0064089c03740c7c033c00740d7c0064098d010100740c7c0319005300290a4e547a2854686973207374616b696e6720706f6f6c206973206e6f74206f70656e207269676874206e6f772e72010000007a19596f75206d757374207374616b6520736f6d657468696e672e4629037250000000da02746fda0c6d61696e5f6163636f756e742901da116e65775f7374616b65645f616d6f756e742903da0e7374617274696e675f65706f63687228000000725000000029017250000000290e724c0000007259000000725a00000072380000007239000000722f000000da0d7472616e736665725f66726f6dda0474686973723c0000007237000000da165f5f646563696465496e6372656d656e7445706f636872440000007253000000da0c5f5f6d696e7456546f6b656e2907725000000072510000007252000000725600000072290000007263000000da0b65706f63685f696e646578724d000000724d000000724e00000072540000006a000000731e000000000106010e011001060108010a010801080108010a010a0104010c010a0172540000006303000000000000000e000000060000004300000073600100007c0164016b08720e74006a016e0474006a027d0374036a04830064026b02732874056403830182017c0064046b057338740564058301820174067c0319007d047c0464066b09735074056407830182017c0064046b0472727c0264066b08727274076a087c0074006a097c0364088d030100740a7c0319007d0564047d0664047d0764047d087c06740b7c0464098d0137007d067c04640a19007d097c04640b19007d077c067c0538007d067c0664046b0472e27c06740c6a04830014007d0a7c0a64046b0472da740d6a0e740f6a0483007c0a640c8d0201007c067c0a18007d087c087c0717007c0017007d0b74106a0483007d0c7c0c7c0817007c0017007d0d74106a117c0d8301010074126a1174126a0483007c0617008301010074137c087c001700640d8d0101006404740a7c033c0074147c0d640e8d017c097c0b74157416830174157c0983011800640f9c0474067c033c0074067c031900530029104e7239000000547a2854686973207374616b696e6720706f6f6c206973206e6f74206f70656e207269676874206e6f772e72010000007a24596f752063616e6e6f74207374616b652061206e656761746976652062616c616e63652e467a2354686973207573657220686173206e6f206465706f73697420746f2061646420746f2e2903725000000072610000007262000000290172570000007228000000725000000029027261000000725000000029017250000000290172630000002904726400000072280000007250000000da0b737465705f6f6666736574291772380000007239000000725e000000724c0000007259000000725a0000007253000000722f00000072650000007266000000da0d5f5f5769746864726177616c73da105f5f63616c63756c6174655969656c6472480000007230000000da087472616e73666572723a000000723c0000007237000000723d00000072680000007267000000da105f5f66697454696d65546f52616e67657244000000290e72500000007251000000725200000072560000007257000000da0f77697468647261776e5f7969656c64da107969656c645f746f5f68617276657374da0e6578697374696e675f7374616b65da10757365725f7969656c645f7368617265da126465706f7369745f73746172745f74696d65da096465765f7368617265da14746f74616c5f6465706f7369745f616d6f756e74da14676c6f62616c5f616d6f756e745f7374616b6564da116e65775f676c6f62616c5f7374616b6564724d000000724d000000724e00000072550000007c00000073440000000001140106010e0110010801100110010a01080108010401040104010e0108010801080108010c010801120108010c0108010c010a0112010e0108010201080108011201725500000029037250000000da0674617267657472560000006303000000000000000a000000040000004300000073bc00000074007c0219007d037c0364016b097318740164028301820174027c0219007d0464037d057c0574037c0364048d0137007d057c057c0438007d057c007c056b0072467c006e027c057d067c0664036b04735a74016405830182017c0674046a05830014007d077c0764036b04728074066a0774086a0583007c0764068d0201007c067c0718007d0874066a077c017c0864068d0201007c047c06170074027c023c0074096a0583007c0617007d0974096a0a7c09830101007c08530029074e467a2b596f752068617665206e6f206465706f73697420746f207769746864726177207969656c642066726f6d2e7201000000290172570000007a295468657265206973206e6f207969656c6420746f2068617276657374207269676874206e6f77203a28290272610000007250000000290b7253000000725a000000726b000000726c000000724800000072590000007230000000726d000000723a000000723d0000007237000000290a7250000000727800000072560000007257000000726f000000da116861727665737461626c655f7969656c6472700000007274000000da0a757365725f7368617265da146e65775f77697468647261776e5f616d6f756e74724d000000724d000000724e000000da135f5f73656e645969656c64546f546172676574a10000007324000000000108011001080104010e0108010c01040110010c010801120108010e010c010c010a01727c00000063010000000000000002000000050000004300000073240000007c0064016b047310740064028301820174016a027d0174037c007c017c0164038d03530029044e72010000007a25596f752063616e6e6f7420686172766573742061206e656761746976652062616c616e636529037250000000727800000072560000002904725a00000072380000007239000000727c000000290272500000007256000000724d000000724d000000724e000000da0d77697468647261775969656c64b60000007306000000000210010601727d00000063000000000000000009000000040000004300000073fa00000074006a017d0074027c0019007d017c0164016b09731e740364028301820174047c0019007d0264037d0364037d0464037d057c0474057c0164048d0137007d047c037c016405190037007d0374066a077c007c0364068d02010074087c0364078d0101007c047c0238007d047c0464036b0472b07c0474096a0a830014007d067c0664036b04729a740b6a07740c6a0a83007c0664068d0201007c047c0618007d05740b6a077c007c0564068d020100640174027c003c00640374047c003c00740d6a0a83007c0318007d07740d6a0e7c0783010100740f6a0a83007c0417007d08740f6a0e7c088301010074107c0764088d0101007c05530029094e467a1f596f752068617665206e6f206465706f73697420746f207769746864726177720100000029017257000000725000000029027261000000725000000029017250000000290172630000002911723800000072390000007253000000725a000000726b000000726c000000722f000000726d000000da155f5f72657475726e416e644275726e56546f6b656e724800000072590000007230000000723a000000723c0000007237000000723d0000007267000000290972560000007257000000726f000000da0f7374616b655f746f5f72657475726e7270000000727a00000072740000007263000000727b000000724d000000724d000000724e000000da167769746864726177546f6b656e73416e645969656c64bd0000007334000000000206010801100108010401040104010e010c010e010a01080108010c010801120108010e01080108010c010a010c010a010a01728000000063010000000000000011000000040000004300000073860100007c006a00640183017d017c006a00640283017d027c006a00640383017d037c006a00640483017d047c0464006b09723a7c027c0417007d026e087401740118007d04740283007d057c017d0664057d0764067d089001782a7c067c056b019001728074037c0619007d0974037c066406170019007d0a74046a00830072a074057401830174057c0964021900830118007c0417007d0b74067c0b6a0783017d0864057d0c7c017c056b0272be74057401830174057c02830118007d0c6e547c067c016b0272dc74057c0a64021900830174057c02830118007d0c6e367c067c056b0272fa74057401830174057c0964021900830118007d0c6e1874057c0a64021900830174057c0964021900830118007d0c64057d0d7c0364056b099001723a7c096407190064056b099001723a7c037c09640719001b007d0d7c09640819007d0e7c0c6a0874097c0e830114007d0f740a6a0b7c0d83010100740a6a0083007d0d7c0f7c0d14007c0814007d107c077c1037007d077c06640637007d06715857007c07530029094e726400000072280000007250000000726a0000007201000000721b0000007229000000722a000000290c72590000007244000000da165f5f67657443757272656e7445706f6368496e64657872450000007240000000726e000000da125f5f66696e6454696d6552616d7053746570da0464617973da077365636f6e6473da1a5f5f676574456d697373696f6e526174655065725365636f6e64da175f5f646563696d616c5f636f6e7665727465725f766172723700000029117257000000da147374617274696e675f65706f63685f696e64657872730000007250000000726a000000da1363757272656e745f65706f63685f696e646578da10746869735f65706f63685f696e646578da0179da1474696d655f737465705f6d756c7469706c696572da0a746869735f65706f6368da0a6e6578745f65706f6368da0f74696d655f72616d705f64656c7461da0564656c7461da127063745f73686172655f6f665f7374616b65da16656d697373696f6e5f726174655f7065725f686f7572da17676c6f62616c5f7969656c645f746869735f65706f6368da186465706f7369745f7969656c645f746869735f65706f6368724d000000724d000000724e000000726c000000db000000734e00000000010a010a010a010a0108010a02080106010401040104010e0108010c01080218010a0104010801120208010c010a01080116030c010c01040118010c010801060108010a0108020c0108010c01726c00000029017228000000630100000000000000010000000200000043000000732e0000007c0074006a0183006b00721674006a0183007d006e147c0074026a0183006b04722a74026a0183007d007c00530029014e290372490000007259000000724b00000029017228000000724d000000724d000000724e000000726e0000000b010000730a00000000010c010a010c010801726e000000630000000000000000010000000100000043000000730c00000074006a0183007d007c00530029014e2902723b000000725900000029017288000000724d000000724d000000724e0000007281000000130100007304000000000108017281000000290172630000006301000000000000000600000004000000430000007362000000740083007d0174017c0119007d027c02640119007d0374027c026402190018007d047c046a0364036b0472327c046a036e0264037d057c0574046a0583006b0573567c0364036b08735674067c007c0364048d02725e74077c0083017d017c01530029054e72290000007228000000720100000029027263000000da11746869735f65706f63685f7374616b656429087281000000724500000072440000007284000000723f0000007259000000da1e5f5f6d61785374616b65644368616e6765526174696f4578636565646564da105f5f696e6372656d656e7445706f6368290672630000007269000000728c0000007294000000728f000000da0d64656c74615f7365636f6e6473724d000000724d000000724e000000726700000018010000731600000000010601080108010c0114010c010a01020108010801726700000029027263000000729400000063020000000000000005000000030000004300000073480000007c007c016b01720c7c006e027c017d027c007c016b05721c7c006e027c017d037c037c0218007d047c017400640183016b007238740153007c047c011b0074026a0383006b05530029024e7a06302e3030303129047243000000da0474727565723e0000007259000000290572630000007294000000da07736d616c6c6572da06626967676572da03646966724d000000724d000000724e000000729500000026010000731000000000020c0104010c01040108010c0104017295000000630100000000000000030000000400000043000000733600000074006a0183007d017c01640117007d0274006a027c028301010074037c0074047c0119006402190064039c0374047c023c007c02530029044e721b000000722a000000290372280000007229000000722a0000002905723b000000725900000072370000007244000000724500000029037263000000da0d63757272656e745f65706f6368da0d6e65775f65706f63685f696478724d000000724d000000724e000000729600000032010000730c0000000001080108010a010401140172960000002901da0f616d6f756e745f7065725f686f75726301000000000000000300000004000000430000007340000000740083000100740183007d017c01640117007d0274026a037c028301010074047c0064028d010100740574066a0783007c0064039c0374087c023c006400530029044e721b00000029017250000000290372280000007229000000722a0000002909da0d5f5f6173736572744f776e65727281000000723b0000007237000000da185f5f736574456d697373696f6e52617465506572486f75727244000000723c000000725900000072450000002903729e000000729c000000729d000000724d000000724d000000724e000000da136368616e6765416d6f756e74506572486f75723b010000730e00000000020601060108010a010a01080172a10000002901da0b6d696e5f7365636f6e647363010000000000000001000000020000004300000073240000007400830001007c0064016b057316740164028301820174026a037c00830101006400530029034e72010000007a21796f75206d7573742063686f6f7365206120706f7369746976652076616c75652e2904729f000000725a000000723f0000007237000000290172a2000000724d000000724d000000724e000000da0f73657445706f63684d696e54696d6546010000730600000000020601100172a30000002901da05726174696f63010000000000000001000000020000004300000073240000007400830001007c0064016b047316740164028301820174026a037c00830101006400530029034e72010000007a186d757374206265206120706f7369746976652076616c75652904729f000000725a000000723e0000007237000000290172a4000000724d000000724d000000724e000000da1873657445706f63684d6178526174696f496e6372656173654d010000730600000000020601100172a50000002901729100000063010000000000000003000000020000004300000073140000007c0064011b007d017c0164011b007d027c02530029024ee93c000000724d00000029037291000000da18656d697373696f6e5f726174655f7065725f6d696e757465da18656d697373696f6e5f726174655f7065725f7365636f6e64724d000000724d000000724e000000728500000054010000730600000000010801080172850000002901da02766b630100000000000000010000000200000043000000731400000074008300010074016a027c00830101006400530029014e2903729f00000072360000007237000000290172a9000000724d000000724d000000724e000000da087365744f776e65725a01000073040000000002060172aa000000630100000000000000010000000200000043000000731400000074008300010074016a027c00830101006400530029014e2903729f000000723a0000007237000000290172a9000000724d000000724d000000724e000000da0c73657444657657616c6c65746001000073040000000002060172ab000000630100000000000000010000000200000043000000732c0000007400830001007c0064016b0072167c0064026b05731e740164038301820174026a037c00830101006400530029044e721b00000072010000007a26416d6f756e74206d75737420626520612076616c7565206265747765656e203020616e6420312904729f000000725a0000007248000000723700000029017250000000724d000000724d000000724e000000da0f73657444657652657761726450637466010000730600000000020601180172ac000000630100000000000000010000000200000043000000731400000074008300010074016a027c00830101006400530029014e2903729f0000007247000000723700000029017250000000724d000000724d000000724e00000072a00000006d01000073040000000001060172a0000000630100000000000000020000000200000043000000733200000074008300010074016a0283007d017c007c016b06721a640053007c016a037c008301010074016a047c01830101006400530029014e2905729f00000072410000007259000000da06617070656e64723700000029027204000000da11747275737465645f6578706f7274657273724d000000724d000000724e000000da15616464546f547275737465644578706f727465727372010000730c000000000206010801080104010a0172af000000630100000000000000020000000200000043000000732600000074008300010074016a0283007d017c016a037c008301010074016a047c01830101006400530029014e2905729f00000072410000007259000000da0672656d6f766572370000002902720400000072ae000000724d000000724d000000724e000000da1a72656d6f766546726f6d547275737465644578706f72746572737c01000073080000000002060108010a0172b1000000630000000000000000040000000600000043000000734a00000074008300010074016a0283007d00740374046401190064026403640464058d047d017c0174056a0619007d027c027c0018007d0374076a087c0374096a02830064068d0201006400530029074e7230000000721a0000007202000000da0e7969656c645f62616c616e6365732904da10666f726569676e5f636f6e7472616374da0c666f726569676e5f6e616d6572040000007205000000290272500000007261000000290a729f000000723c0000007259000000da0b466f726569676e486173687246000000723800000072660000007230000000726d00000072360000002904da0e7374616b65645f62616c616e6365da105f5f7969656c645f62616c616e636573da11746f74616c5f696e5f636f6e7472616374da0f746f74616c5f617661696c61626c65724d000000724d000000724e000000da117265636f7665725969656c64546f6b656e8401000073100000000002060108010801040108010a01080172ba0000002901da0769735f6f70656e630100000000000000010000000200000043000000731400000074008300010074016a027c00830101006400530029014e2903729f000000724c0000007237000000290172bb000000724d000000724d000000724e000000da0c616c6c6f775374616b696e679001000073040000000002060172bc00000029047232000000723300000072340000007235000000630400000000000000050000000500000043000000732400000074008300010074016a017c007c017c027c0383047d0474026a037c04830101006400530029014e2904729f000000724a00000072490000007237000000290572320000007233000000723400000072350000007228000000724d000000724d000000724e000000da0c736574537461727454696d6596010000730600000000020601100172bd000000630400000000000000050000000500000043000000732400000074008300010074016a017c007c017c027c0383047d0474026a037c04830101006400530029014e2904729f000000724a000000724b0000007237000000290572320000007233000000723400000072350000007228000000724d000000724d000000724e000000da0a736574456e6454696d659d010000730600000000020601100172be000000630000000000000000000000000200000043000000731a00000074006a01830074026a036b02731674046401830182016400530029024e7a2c596f75206d75737420626520746865206f776e657220746f2063616c6c20746869732066756e6374696f6e2e29057236000000725900000072380000007239000000725a000000724d000000724d000000724d000000724e000000729f000000a4010000730400000000010601729f000000630000000000000000040000000400000043000000737e00000074006a017d0074027c0019007d0174027c00190064016b097322740364028301820164037d027c027c016404190037007d0274046a057c007c0264058d02010074067c0264068d010100640174027c003c00640374077c003c0074086a0983007c0218007d0374086a0a7c0383010100740b7c0364078d0101006400530029084e467a2754686973206163636f756e7420686173206e6f206465706f7369747320746f2072657475726e2e720100000072500000002902726100000072500000002901725000000029017263000000290c723800000072390000007253000000725a000000722f000000726d000000727e000000726b000000723c000000725900000072370000007267000000290472560000007257000000727f0000007263000000724d000000724d000000724e000000da14656d657267656e637952657475726e5374616b65a9010000731a00000000020601080106010e0104010c010e010a01080108010c010a0172bf0000002901da026f6e630100000000000000010000000200000043000000731400000074008300010074016a027c00830101006400530029014e2903729f00000072400000007237000000290172c0000000724d000000724d000000724e000000da0e746f67676c6554696d6552616d70ba01000073040000000002060172c100000029017283000000630100000000000000040000000300000043000000735a00000074006a0183007d0164007d0278287c0144005d207d037c03640119007c006b0172127c03640219007c006b0472127c037d02711257007c0264006b0872527c0174027c0183016403180019006404190053007c0264041900530029054e721d000000721e000000721b000000721f000000290372420000007259000000da036c656e29047283000000da0a74696d655f72616d7073da0473746570da0173724d000000724d000000724e0000007282000000c001000073100000000001080104010a01180108010801140172820000002901da0464617461630100000000000000010000000200000043000000731400000074008300010074016a027c00830101006400530029014e2903729f00000072420000007237000000290172c6000000724d000000724d000000724e000000da1173657454696d6552616d7056616c756573cb01000073040000000002060172c7000000290272500000007261000000630200000000000000020000000400000043000000734c0000007c0064016b0473107400640283018201740174026a0319007c006b0573267400640383018201740174026a03050019007c00380003003c0074017c01050019007c00370003003c006400530029044e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a1b4e6f7420656e6f7567682056544f4b454e5320746f2073656e64212904725a000000da0a5f5f62616c616e63657372380000007239000000290272500000007261000000724d000000724d000000724e000000726d000000d101000073080000000002100116011201726d000000630200000000000000020000000400000043000000732a0000007c0064016b0473107400640283018201740174026a037c016602050019007c00370003003c006400530029034e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573212904725a00000072c800000072380000007239000000290272500000007261000000724d000000724d000000724e000000da07617070726f7665d901000073040000000002100172c90000002903725000000072610000007262000000630300000000000000030000000500000043000000738a0000007c0064016b047310740064028301820174017c0274026a03660219007c006b05733c740064036a0474017c0274026a03660219007c0083028301820174017c0219007c006b057350740064048301820174017c0274026a036602050019007c00380003003c0074017c02050019007c00380003003c0074017c01050019007c00370003003c006400530029054e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a494e6f7420656e6f75676820636f696e7320617070726f76656420746f2073656e642120596f752068617665207b7d20616e642061726520747279696e6720746f207370656e64207b7d7a194e6f7420656e6f75676820636f696e7320746f2073656e64212905725a00000072c800000072380000007239000000da06666f726d61742903725000000072610000007262000000724d000000724d000000724e0000007265000000df0100007310000000000210010c010c0114011401160110017265000000630100000000000000020000000400000043000000732e00000074006a017d0174027c0119007c006b05731a740364018301820174027c01050019007c00380003003c006400530029024e7a4e596f75722056544f4b454e2062616c616e636520697320746f6f206c6f7720746f20756e7374616b652c207265636f76657220796f75722056544f4b454e5320616e642074727920616761696e2e29047238000000723900000072c8000000725a000000290272500000007256000000724d000000724d000000724e000000727e000000eb01000073080000000001060106010e01727e000000630100000000000000020000000400000043000000731a00000074006a017d0174027c01050019007c00370003003c006400530029014e29037238000000725e00000072c8000000290272500000007256000000724d000000724d000000724e0000007268000000f201000073040000000001060172680000002949722e000000da09696d706f72746c6962725b000000722f0000007230000000da085661726961626c657236000000723a000000724700000072480000007249000000724b000000724c000000da04486173687253000000726b000000723b0000007245000000723c000000723d000000723f000000723e0000007246000000728600000072420000007240000000724100000072c8000000724f000000da085f5f6578706f7274da05666c6f61747258000000da037374727260000000da04626f6f6c72540000007255000000727c000000727d0000007280000000726c000000da03416e79726e000000728100000072670000007295000000729600000072a100000072a300000072a5000000728500000072aa00000072ab00000072ac00000072a000000072af00000072b100000072ba00000072bc000000da03696e7472bd00000072be000000729f00000072bf00000072c10000007282000000da046c69737472c7000000726d00000072c90000007265000000727e0000007268000000724d000000724d000000724d000000724e000000da083c6d6f64756c653e0100000073c800000008010401040104010c010401080104010801040108010c010c0104010801060108010601080104010801060108010401080104010801040108010401080106010801040108010401080104010801040108010601080308200601100b0601100f12121225121506011006101e08300e0808050e0e02010e0b0e090601100a06011006060110060e060601100506011005060110060e050601100906011007100c06011005060116060601160608051011060110050e0b0601100506011207060112050601140b0e07
 
Contract con_staking_rswp_interop
Variable __owner__
New Value null
 
Contract con_staking_rswp_interop
Variable __submitted__
New Value 2021,7,11,12,7,32,0
 
Contract con_staking_rswp_interop
Variable __developer__
New Value 7c296eb80e379171f694a3c5be7640d16f300f09d731c99ac0a92f49c9c0c151
 
Contract currency
Variable balances
Key 7c296eb80e379171f694a3c5be7640d16f300f09d731c99ac0a92f49c9c0c151
New Value 46601.034004273389636691593786079483