def post( self, name, symbol, bonding_collateral_equation, bonding_liquidity_spread, params_expiration_time, params_min_participation_pct, params_support_required_pct, ): return create_transaction( None, ( db.session.query(Contract) .filter_by(contract_type="BAND_FACTORY") .one_or_none() or abort(400, message="Band factory not found") ).address, "createCommunity(string,string,uint256[],uint256,uint256,uint256,uint256)", ("string", name), ("string", symbol), ( "uint256[]", [int(token, 0) for token in bonding_collateral_equation], ), ("uint256", bonding_liquidity_spread), ("uint256", params_expiration_time), ("uint256", params_min_participation_pct), ("uint256", params_support_required_pct), )
def post( self, addr, prefix, decay_function, min_deposit, apply_stage_length, dispensation_percentage, commit_time, reveal_time, min_participation_pct, support_required_pct, ): return create_transaction( None, addr, "createTCR(bytes8,uint256[],uint256,uint256,uint256,uint256,uint256,uint256,uint256)", ("bytes8", bytes(prefix, "utf-8")), ("uint256[]", [int(token, 0) for token in decay_function]), ("uint256", min_deposit), ("uint256", apply_stage_length), ("uint256", dispensation_percentage), ("uint256", commit_time), ("uint256", reveal_time), ("uint256", min_participation_pct), ("uint256", support_required_pct), )
def post(self, addr, reward_owner, challenge_id): return create_transaction( reward_owner, addr, "claimReward(address,uint256)", ("address", reward_owner), ("uint256", challenge_id), )
def post(self, addr, sender, data_hash): return create_transaction( sender, addr, "exit(address,bytes32)", ("address", sender), ("bytes32", to_bytes(hexstr=data_hash)), )
def post(self, addr, sender, data_hash, amount): return create_transaction( sender, addr, "withdraw(address,bytes32,uint256)", ("address", sender), ("bytes32", to_bytes(hexstr=data_hash)), ("uint256", amount), )
def post(self, sender, withdraw_ownership, data_source, addr): return create_transaction( sender, addr, "withdraw(address,uint256,address)", ("address", sender), ("uint256", withdraw_ownership), ("address", data_source), )
def post(self, sender, to, value, addr, comm): token_contract = comm.token_collection[0] return create_transaction( sender, token_contract.address, "transferFeeless(address,address,uint256)", ("address", sender), ("address", to), ("uint256", value), )
def post(self, sender, reason_hash, addr, comm, param, keys, values): return create_transaction( sender, param.address, "propose(address,bytes32,bytes32[],uint256[])", ("address", sender), ("bytes32", to_bytes(hexstr=reason_hash)), ("bytes32[]", [bytes(key, "utf-8") for key in keys]), ("uint256[]", [int(value, 0) for value in values]), )
def post(self, addr, sender, yes_vote, no_vote, on_chain_id, poll_contract): return create_transaction( sender, get_voting_address(poll_contract.address), "castVote(address,address,uint256,uint256,uint256)", ("address", sender), ("address", poll_contract.address), ("uint256", on_chain_id), ("uint256", yes_vote), ("uint256", no_vote), )
def post(self, sender, to, value): band_contract = ( db.session.query(Contract) .filter_by(contract_type="BAND_TOKEN") .one_or_none() ) or abort(400) return create_transaction( sender, band_contract.address, "transferFeeless(address,address,uint256)", ("address", sender), ("address", to), ("uint256", value), )
def post( self, addr, min_provider_stake, max_provider_count, owner_revenue_pct, query_price, ): return create_transaction( None, addr, "createTCD(uint256,uint256,uint256,uint256)", ("uint256", min_provider_stake), ("uint256", max_provider_count), ("uint256", owner_revenue_pct), ("uint256", query_price), )
def post( self, addr, sender, commit_hash, total_weight, on_chain_id, poll_contract, ): return create_transaction( sender, get_voting_address(poll_contract.address), "commitVote(address,address,uint256,bytes32,bytes32,uint256,uint256 )", ("address", sender), ("address", poll_contract.address), ("uint256", on_chain_id), ("bytes32", to_bytes(hexstr=commit_hash)), ("bytes32", b""), ("uint256", total_weight), ("uint256", 0), )
def post(self, key, addr): return create_transaction(None, addr, "getAsNumber(bytes32)", ("bytes32", to_bytes(text=key)))
def post(self, token_amount, addr): return create_transaction(None, addr, "distributeFee(uint256)", ("uint256", token_amount))
def post(self, data_source, addr): return create_transaction(None, addr, "kick(address)", ("address", data_source))