From c99d63371ab8106171be3333fe86914054bb9817 Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Fri, 23 Aug 2024 17:28:23 +0200 Subject: [PATCH 01/11] fix: unstaking flows --- scripts/staking.py | 219 ++++++++++------------------------ terminate_on_chain_service.sh | 5 +- 2 files changed, 63 insertions(+), 161 deletions(-) diff --git a/scripts/staking.py b/scripts/staking.py index 61e26c1..0c4f165 100644 --- a/scripts/staking.py +++ b/scripts/staking.py @@ -59,77 +59,6 @@ def _format_duration(duration_seconds: int) -> str: return formatted_duration -def _unstake_old_program( - ledger_api: EthereumApi, - service_id: int, - staking_contract_address: str, - staking_program: str, - owner_crypto: EthereumCrypto, -) -> None: - print(f"Checking if service is staked on {staking_program}...") - - # Check if service is staked - if staking_program.startswith("quickstart_alpha_everest"): - if service_id not in get_service_ids(ledger_api, staking_contract_address): - print(f"Service {service_id} is not staked on {staking_program}.") - return - else: - if not is_service_staked( - ledger_api, service_id, staking_contract_address - ): - print(f"Service {service_id} is not staked on {staking_program}..") - return - - can_unstake = _check_unstaking_availability( - ledger_api, - service_id, - staking_contract_address, - staking_program, - ) - if not can_unstake: - print( - "\n" - "WARNING: Service cannot be unstaked yet\n" - "---------------------------------------\n" - f"Service {service_id} cannot be unstaked from {staking_program} at this time.\n" - f"You can still run your service, but it will stay staked in {staking_program}.\n" - "Please, try re-running this script again at a later time to try stake on a new program.\n" - ) - input("Press Enter to continue...") - sys.exit(0) - - print( - f"Service {service_id} is staked on {staking_program}. To continue in a new staking program, first, it must be unstaked from {staking_program}." - ) - user_input = input( - f"Do you want to continue unstaking service {service_id} from {staking_program}? (yes/no)\n" - ).lower() - print() - - if user_input not in ["yes", "y"]: - print("Terminating script.") - sys.exit(1) - - print(f"Unstaking service {service_id} from {staking_program}...") - unstake_txs = get_unstake_txs(ledger_api, service_id, staking_contract_address) - for tx in unstake_txs: - send_tx_and_wait_for_receipt(ledger_api, owner_crypto, tx) - print(f"Successfully unstaked service {service_id} from {staking_program}.") - - -def _unstake_all_old_programs( - ledger_api: EthereumApi, - service_id: int, - owner_crypto: EthereumCrypto, - current_staking_contract_address: str -) -> None: - print("Unstaking from old programs...") - for program_id, details in DEPRECATED_STAKING_PROGRAMS.items(): - staking_token_instance_address = details['deployment']['stakingTokenInstanceAddress'] - if staking_token_instance_address != current_staking_contract_address: - _unstake_old_program(ledger_api, service_id, staking_token_instance_address, program_id, owner_crypto) - - def _check_unstaking_availability( ledger_api: EthereumApi, service_id: int, @@ -163,7 +92,7 @@ def _get_current_staking_program(ledger_api, service_id): del all_staking_programs["no_staking"] del all_staking_programs["quickstart_alpha_everest"] # Very old program, not used likely - causes issues on "is_service_staked" - staking_program = None + staking_program = "no_staking" staking_contract_address = None for program, data in all_staking_programs.items(): address = data["deployment"]["stakingTokenInstanceAddress"] @@ -182,14 +111,15 @@ def _try_unstake_service( ledger_api: EthereumApi, service_id: int, owner_crypto: EthereumCrypto, - service_registry_address: str, + warn_if_checkpoint_unavailable: bool = True, ) -> None: staking_contract_address, staking_program = _get_current_staking_program(ledger_api, service_id) # Exit if not staked if staking_contract_address is None: - sys.exit(0) + print(f"Service {service_id} is not staked in any active program.") + return # Collect information next_ts = get_next_checkpoint_ts(ledger_api, staking_contract_address) @@ -216,7 +146,7 @@ def _try_unstake_service( print("Terminating script.") sys.exit(1) - if now < next_ts: + if warn_if_checkpoint_unavailable and (now < next_ts): formatted_last_ts = datetime.utcfromtimestamp(last_ts).strftime( "%Y-%m-%d %H:%M:%S UTC" ) @@ -264,6 +194,12 @@ def _try_stake_service( staking_contract_address: str, staking_program: str, ) -> None: + + print(f"Service {service_id} has set {staking_program} staking program.") + + if staking_program == "no_staking": + return + if get_available_staking_slots(ledger_api, staking_contract_address) > 0: print( f"Service {service_id} is not staked on {staking_program}. Checking for available rewards..." @@ -271,7 +207,7 @@ def _try_stake_service( available_rewards = get_available_rewards(ledger_api, staking_contract_address) if available_rewards == 0: # no rewards available, do nothing - print(f"No rewards available. Service {service_id} cannot be staked.") + print(f"No rewards available on the {current_program} staking program. Service {service_id} cannot be staked.") sys.exit(0) print( @@ -340,107 +276,74 @@ def main() -> None: private_key_path=args.owner_private_key_path, password=args.password ) - # No need to execute this instruction here, as the user can choose the staking program - # - # _unstake_all_old_programs( - # ledger_api=ledger_api, - # service_id=args.service_id, - # owner_crypto=owner_crypto, - # current_staking_contract_address=args.staking_contract_address - # ) - available_rewards = get_available_rewards( ledger_api, args.staking_contract_address ) + # -------------- + # Unstaking flow + # -------------- if args.unstake: _try_unstake_service( ledger_api=ledger_api, service_id=args.service_id, owner_crypto=owner_crypto, - service_registry_address=args.service_registry_address, ) + sys.exit(0) - if is_service_staked( - ledger_api, args.service_id, args.staking_contract_address - ): - - _, current_program = _get_current_staking_program(ledger_api, args.service_id) - env_file_vars = dotenv_values(DOTENV_PATH) - target_program = env_file_vars.get("STAKING_PROGRAM") - - if current_program != target_program: - print( - f"WARNING: Service {args.service_id} is staked on {current_program}, but target program is {target_program}. Unstaking..." - ) - _try_unstake_service( - ledger_api=ledger_api, - service_id=args.service_id, - owner_crypto=owner_crypto, - service_registry_address=args.service_registry_address, - ) - - if is_service_evicted( - ledger_api, args.service_id, args.staking_contract_address - ): - print( - f"Service {args.service_id} has been evicted from the {staking_program} staking program due to inactivity. Unstaking..." - ) - - can_unstake = _check_unstaking_availability( - ledger_api, - args.service_id, - args.staking_contract_address, - staking_program, - ) - - if not can_unstake: - print("Terminating script.") - sys.exit(1) - - unstake_txs = get_unstake_txs( - ledger_api, args.service_id, args.staking_contract_address - ) - for tx in unstake_txs: - send_tx_and_wait_for_receipt(ledger_api, owner_crypto, tx) - - print( - f"Successfully unstaked service {args.service_id} from {staking_program}." - ) - - _try_stake_service( - ledger_api=ledger_api, - service_id=args.service_id, - owner_crypto=owner_crypto, - service_registry_address=args.service_registry_address, - staking_contract_address=args.staking_contract_address, - staking_program=staking_program, - ) - sys.exit(0) + # -------------- + # Staking flow + # -------------- + current_staking_contract_address, current_program = _get_current_staking_program(ledger_api, args.service_id) + is_staked = current_program != "no_staking" + env_file_vars = dotenv_values(DOTENV_PATH) + target_program = env_file_vars.get("STAKING_PROGRAM") + if is_staked and current_program != target_program: print( - f"Service {args.service_id} is already staked on {staking_program}. " - f"Checking if the staking contract has any rewards..." + f"WARNING: Service {args.service_id} is staked on {current_program}, but target program is {target_program}. Unstaking..." ) - available_rewards = get_available_rewards( - ledger_api, args.staking_contract_address + _try_unstake_service( + ledger_api=ledger_api, + service_id=args.service_id, + owner_crypto=owner_crypto, ) - if available_rewards == 0: - print( - f"No rewards available. Unstaking service {args.service_id} from {staking_program}..." - ) - _try_unstake_service( - ledger_api=ledger_api, - service_id=args.service_id, - owner_crypto=owner_crypto, - service_registry_address=args.service_registry_address, - ) - sys.exit(0) + is_staked = False + + if is_staked and is_service_evicted( + ledger_api, args.service_id, current_staking_contract_address + ): + print( + f"Service {args.service_id} has been evicted from the {current_program} staking program due to inactivity. Unstaking..." + ) + _try_unstake_service( + ledger_api=ledger_api, + service_id=args.service_id, + owner_crypto=owner_crypto, + warn_if_checkpoint_unavailable=False, + ) + is_staked = False + if is_staked and get_available_rewards(ledger_api, current_staking_contract_address) == 0: + print( + f"No rewards available on the {current_program} staking program. Unstaking service {args.service_id} from {current_program}..." + ) + _try_unstake_service( + ledger_api=ledger_api, + service_id=args.service_id, + owner_crypto=owner_crypto, + ) + is_staked = False + else: print( f"There are rewards available. The service {args.service_id} should remain staked." ) - sys.exit(0) + + if is_staked: + print( + f"Service {args.service_id} is already staked on {staking_program}. " + f"Checking if the staking contract has any rewards..." + ) else: _try_stake_service( ledger_api=ledger_api, diff --git a/terminate_on_chain_service.sh b/terminate_on_chain_service.sh index 5a92d0f..1c917cb 100755 --- a/terminate_on_chain_service.sh +++ b/terminate_on_chain_service.sh @@ -160,9 +160,8 @@ ask_password_if_needed cd trader validate_password -if [ "${USE_STAKING}" = true ]; then - poetry run python "../scripts/staking.py" "$service_id" "$CUSTOM_SERVICE_REGISTRY_ADDRESS" "$CUSTOM_STAKING_ADDRESS" "../$operator_pkey_path" "$rpc" "$unstake"; -fi +# Unstake if applicable +poetry run python "../scripts/staking.py" "$service_id" "$CUSTOM_SERVICE_REGISTRY_ADDRESS" "$CUSTOM_STAKING_ADDRESS" "../$operator_pkey_path" "$rpc" "$unstake"; service_safe_address=$(cat "../$service_safe_address_path") current_safe_owners=$(poetry run python "../scripts/get_safe_owners.py" "$service_safe_address" "../$agent_pkey_path" "$rpc" $password_argument | awk '{gsub(/"/, "\047", $0); print $0}') From 2095388da78c6e2fc31a1e073d69f14f008ecbd6 Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Sat, 24 Aug 2024 11:34:40 +0200 Subject: [PATCH 02/11] chore: update script --- run_service.sh | 6 +++++- scripts/staking.py | 16 ++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/run_service.sh b/run_service.sh index fc1057e..5484731 100755 --- a/run_service.sh +++ b/run_service.sh @@ -880,7 +880,7 @@ remote_service_hash=$(poetry run python "../scripts/service_hash.py") operator_address=$(get_address "../$operator_keys_file") on_chain_agent_id=$(get_on_chain_agent_ids "$service_id") -if [ "$local_service_hash" != "$remote_service_hash" ] || [ "$on_chain_agent_id" != "$AGENT_ID" ]; then +if [ "$local_service_hash" == "$remote_service_hash" ] || [ "$on_chain_agent_id" != "$AGENT_ID" ]; then echo "" echo "WARNING: Your on-chain service configuration is out-of-date" echo "-----------------------------------------------------------" @@ -974,6 +974,10 @@ if [ "$local_service_hash" != "$remote_service_hash" ] || [ "$on_chain_agent_id" export cmd="" if [ "${USE_STAKING}" = true ]; then cost_of_bonding=$MIN_STAKING_BOND_OLAS + + + echo "$cost_of_bonding" + echo "......................" poetry run python "../scripts/update_service.py" "../$operator_pkey_path" "$nft" "$AGENT_ID" "$service_id" "$CUSTOM_OLAS_ADDRESS" "$cost_of_bonding" "packages/valory/services/trader/" "$rpc" $password_argument else cost_of_bonding=$MIN_STAKING_BOND_XDAI diff --git a/scripts/staking.py b/scripts/staking.py index 0c4f165..5192264 100644 --- a/scripts/staking.py +++ b/scripts/staking.py @@ -269,6 +269,9 @@ def main() -> None: args = parser.parse_args() staking_program = args.staking_contract_address + env_file_vars = dotenv_values(DOTENV_PATH) + target_program = env_file_vars.get("STAKING_PROGRAM") + print(f"Starting {Path(__file__).name} script ({staking_program})...\n") ledger_api = EthereumApi(address=args.rpc) @@ -276,9 +279,7 @@ def main() -> None: private_key_path=args.owner_private_key_path, password=args.password ) - available_rewards = get_available_rewards( - ledger_api, args.staking_contract_address - ) + # -------------- # Unstaking flow @@ -296,8 +297,7 @@ def main() -> None: # -------------- current_staking_contract_address, current_program = _get_current_staking_program(ledger_api, args.service_id) is_staked = current_program != "no_staking" - env_file_vars = dotenv_values(DOTENV_PATH) - target_program = env_file_vars.get("STAKING_PROGRAM") + if is_staked and current_program != target_program: print( @@ -334,7 +334,7 @@ def main() -> None: owner_crypto=owner_crypto, ) is_staked = False - else: + elif is_staked: print( f"There are rewards available. The service {args.service_id} should remain staked." ) @@ -357,10 +357,6 @@ def main() -> None: except Exception as e: # pylint: disable=broad-except print(f"An error occurred while executing {Path(__file__).name}: {str(e)}") traceback.print_exc() - dotenv.unset_key("../.trader_runner/.env", "USE_STAKING") - print( - "\nPlease confirm whether your service is participating in a staking program, and then retry running the script." - ) sys.exit(1) From fbb3832dcff78eb1afdbabc82baf70565572a6bf Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Sat, 24 Aug 2024 20:38:56 +0200 Subject: [PATCH 03/11] chore: fixes on staking flow --- run_service.sh | 58 ++++++----- scripts/choose_staking.py | 161 +++++++++++++++--------------- scripts/staking.py | 22 ++-- scripts/update_service.py | 204 -------------------------------------- scripts/utils.py | 2 +- 5 files changed, 126 insertions(+), 321 deletions(-) delete mode 100644 scripts/update_service.py diff --git a/run_service.sh b/run_service.sh index 5484731..419cd14 100755 --- a/run_service.sh +++ b/run_service.sh @@ -280,6 +280,14 @@ get_on_chain_agent_ids() { echo "$agent_ids" } +get_on_chain_agent_bond() { + local service_id="$1" + local service_info=$(poetry run autonomy service --use-custom-chain info "$service_id") + local on_chain_deposit="$(echo "$service_info" | awk '/Security Deposit/ {sub(/\|[ \t]*Security Deposit[ \t]*\|[ \t]*/, ""); sub(/[ \t]*\|[ \t]*/, ""); print}')" + on_chain_agent_bond=$($PYTHON_CMD -c "print(int(float('$on_chain_deposit')))") + echo "$on_chain_agent_bond" +} + # Move a file if it exists move_if_exists() { local source_file="$1" @@ -879,16 +887,25 @@ local_service_hash="$(grep 'service/valory/trader' $packages | awk -F: '{print $ remote_service_hash=$(poetry run python "../scripts/service_hash.py") operator_address=$(get_address "../$operator_keys_file") on_chain_agent_id=$(get_on_chain_agent_ids "$service_id") +on_chain_agent_bond=$(get_on_chain_agent_bond "$service_id") -if [ "$local_service_hash" == "$remote_service_hash" ] || [ "$on_chain_agent_id" != "$AGENT_ID" ]; then +if [ "${USE_STAKING}" = true ]; then + cost_of_bonding=$MIN_STAKING_BOND_OLAS +else + cost_of_bonding=$MIN_STAKING_BOND_XDAI +fi + +if [ "$local_service_hash" != "$remote_service_hash" ] || [ "$on_chain_agent_id" != "$AGENT_ID" ] || [ "$on_chain_agent_bond" != "$cost_of_bonding" ]; then echo "" echo "WARNING: Your on-chain service configuration is out-of-date" echo "-----------------------------------------------------------" echo "Your currently minted on-chain service (id $service_id) mismatches the local configuration:" echo " - Local service hash ($service_version): $local_service_hash" echo " - On-chain service hash: $remote_service_hash" - echo " - Local agent id: $AGENT_ID" + echo " - Expected agent id: $AGENT_ID" echo " - On-chain agent id: $on_chain_agent_id" + echo " - Expected agent bond: $cost_of_bonding" + echo " - On-chain agent bond: $on_chain_agent_bond" echo "" echo "This is most likely caused due to an update of the trader service code or agent id." echo "The script will proceed now to update the on-chain service." @@ -971,29 +988,26 @@ if [ "$local_service_hash" == "$remote_service_hash" ] || [ "$on_chain_agent_id" verify_staking_slots nft="bafybeig64atqaladigoc3ds4arltdu63wkdrk3gesjfvnfdmz35amv7faq" - export cmd="" + cmd="poetry run autonomy mint \ + --retries $RPC_RETRIES \ + --timeout $RPC_TIMEOUT_SECONDS \ + --use-custom-chain \ + service packages/valory/services/trader/ \ + --key \"../$operator_pkey_path\" $password_argument \ + --nft $nft \ + -a $AGENT_ID \ + -n $n_agents \ + --threshold $n_agents \ + --update \"$service_id\"" + if [ "${USE_STAKING}" = true ]; then cost_of_bonding=$MIN_STAKING_BOND_OLAS - - - echo "$cost_of_bonding" - echo "......................" - poetry run python "../scripts/update_service.py" "../$operator_pkey_path" "$nft" "$AGENT_ID" "$service_id" "$CUSTOM_OLAS_ADDRESS" "$cost_of_bonding" "packages/valory/services/trader/" "$rpc" $password_argument + cmd+=" -c $cost_of_bonding --token $CUSTOM_OLAS_ADDRESS" else cost_of_bonding=$MIN_STAKING_BOND_XDAI - cmd="poetry run autonomy mint \ - --retries $RPC_RETRIES \ - --timeout $RPC_TIMEOUT_SECONDS \ - --use-custom-chain \ - service packages/valory/services/trader/ \ - --key \"../$operator_pkey_path\" $password_argument \ - --nft $nft \ - -a $AGENT_ID \ - -n $n_agents \ - -c $cost_of_bonding \ - --threshold $n_agents \ - --update \"$service_id\"" + cmd+=" -c $cost_of_bonding" fi + eval "$cmd" # Updating a service does not change the on-chain service state. @@ -1075,9 +1089,7 @@ fi # perform staking operations # the following will stake the service in case it is not staked, and there are available rewards # if the service is already staked, and there are no available rewards, it will unstake the service -if [ "${USE_STAKING}" = true ]; then - perform_staking_ops -fi +perform_staking_ops # ensure Safe owner is agent diff --git a/scripts/choose_staking.py b/scripts/choose_staking.py index ca0060a..bb27238 100644 --- a/scripts/choose_staking.py +++ b/scripts/choose_staking.py @@ -25,7 +25,7 @@ import json from dotenv import dotenv_values, set_key, unset_key from pathlib import Path -from typing import Any, Dict, List +from typing import Any, Dict, List, Tuple from web3 import Web3 from eth_utils import keccak @@ -34,76 +34,39 @@ DOTENV_PATH = Path(STORE_PATH, ".env") RPC_PATH = Path(STORE_PATH, "rpc.txt") -IPFS_ADDRESS = "https://gateway.autonolas.tech/ipfs/f01701220{}" +IPFS_ADDRESS = "https://gateway.autonolas.tech/ipfs/f01701220{hash}" NEVERMINED_MECH_CONTRACT_ADDRESS = "0x327E26bDF1CfEa50BFAe35643B23D5268E41F7F9" NEVERMINED_AGENT_REGISTRY_ADDRESS = "0xAed729d4f4b895d8ca84ba022675bB0C44d2cD52" NEVERMINED_MECH_REQUEST_PRICE = "0" ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" DEPRECATED_TEXT = "(DEPRECATED)" - - -def _fetch_json(url): - response = requests.get(url) - response.raise_for_status() - return response.json() - +NO_STAKING_PROGRAM_ID = "no_staking" +NO_STAKING_PROGRAM_ENV_VARIABLES = { + "USE_STAKING": "false", + "STAKING_PROGRAM": NO_STAKING_PROGRAM_ID, + "AGENT_ID": "25", + "CUSTOM_SERVICE_REGISTRY_ADDRESS": "0x9338b5153AE39BB89f50468E608eD9d764B755fD", + "CUSTOM_SERVICE_REGISTRY_TOKEN_UTILITY_ADDRESS": "0xa45E64d13A30a51b91ae0eb182e88a40e9b18eD8", + "MECH_CONTRACT_ADDRESS": "0x77af31De935740567Cf4fF1986D04B2c964A786a", + "CUSTOM_OLAS_ADDRESS": ZERO_ADDRESS, + "CUSTOM_STAKING_ADDRESS": ZERO_ADDRESS, + "MECH_ACTIVITY_CHECKER_CONTRACT": ZERO_ADDRESS, + "MIN_STAKING_BOND_OLAS": "0", + "MIN_STAKING_DEPOSIT_OLAS": "0", +} # Information stored in the "deployment" key is used only to retrieve "stakingTokenInstanceAddress" (proxy) # and "stakingTokenAddress" (implementation). The rest of the parameters are read on-chain. STAKING_PROGRAMS = { - "no_staking": { - "name": "No staking", - "description": "Your Olas Predict agent will still actively participate in prediction markets, but it will not be staked within any staking program.", - "deployment": { - "stakingTokenAddress": "0x43fB32f25dce34EB76c78C7A42C8F40F84BCD237", - "stakingTokenInstanceAddress": "0x43fB32f25dce34EB76c78C7A42C8F40F84BCD237" - } - }, - "quickstart_beta_hobbyist": { - "name": "Quickstart Beta - Hobbyist", - "description": "The Quickstart Beta - Hobbyist staking contract offers 100 slots for operators running Olas Predict agents with the quickstart. It is designed as a step up from Coastal Staker Expeditions, requiring 100 OLAS for staking. The rewards are also more attractive than with Coastal Staker Expeditions.", - # https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/scripts/deployment/globals_gnosis_mainnet_qs_beta_hobbyist.json - "deployment": { - "stakingTokenAddress": "0xEa00be6690a871827fAfD705440D20dd75e67AB1", - "stakingTokenInstanceAddress": "0x389B46c259631Acd6a69Bde8B6cEe218230bAE8C" - } - }, - "quickstart_beta_expert": { - "name": "Quickstart Beta - Expert", - "description": "The Quickstart Beta - Expert staking contract offers 20 slots for operators running Olas Predict agents with the quickstart. It is designed for professional agent operators, requiring 1000 OLAS for staking. The rewards are proportional to the Quickstart Beta - Hobbyist.", - # https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/scripts/deployment/globals_gnosis_mainnet_qs_beta_expert.json - "deployment": { - "stakingTokenAddress": "0xEa00be6690a871827fAfD705440D20dd75e67AB1", - "stakingTokenInstanceAddress": "0x5344B7DD311e5d3DdDd46A4f71481bD7b05AAA3e" - } - }, + NO_STAKING_PROGRAM_ID: ZERO_ADDRESS, + "quickstart_beta_hobbyist": "0x389B46c259631Acd6a69Bde8B6cEe218230bAE8C", + "quickstart_beta_expert": "0x5344B7DD311e5d3DdDd46A4f71481bD7b05AAA3e", + "quickstart_alpha_coastal": "0x43fB32f25dce34EB76c78C7A42C8F40F84BCD237", } DEPRECATED_STAKING_PROGRAMS = { - "quickstart_alpha_everest": { - "name": "Quickstart Alpha - Everest", - "description": "", - "deployment": { - "stakingTokenAddress": "0x5add592ce0a1B5DceCebB5Dcac086Cd9F9e3eA5C", - "stakingTokenInstanceAddress": "0x5add592ce0a1B5DceCebB5Dcac086Cd9F9e3eA5C" - } - }, - "quickstart_alpha_alpine": { - "name": "Quickstart Alpha - Alpine", - "description": "", - "deployment": { - "stakingTokenAddress": "0x2Ef503950Be67a98746F484DA0bBAdA339DF3326", - "stakingTokenInstanceAddress": "0x2Ef503950Be67a98746F484DA0bBAdA339DF3326" - } - }, - "quickstart_alpha_coastal": { - "name": "Quickstart Alpha - Coastal", - "description": "The Quickstart Alpha - Coastal offers 100 slots for operators running Olas Predict agents with the quickstart. It requires 20 OLAS for staking.", - "deployment": { - "stakingTokenAddress": "0x43fB32f25dce34EB76c78C7A42C8F40F84BCD237", - "stakingTokenInstanceAddress": "0x43fB32f25dce34EB76c78C7A42C8F40F84BCD237" - } - } + "quickstart_alpha_everest": "0x5add592ce0a1B5DceCebB5Dcac086Cd9F9e3eA5C", + "quickstart_alpha_alpine": "0x2Ef503950Be67a98746F484DA0bBAdA339DF3326", } @@ -125,9 +88,9 @@ def _prompt_select_staking_program() -> str: print("----------------------------------------------") ids = list(STAKING_PROGRAMS.keys()) for index, key in enumerate(ids): - program = STAKING_PROGRAMS[key] - wrapped_description = textwrap.fill(program['description'], width=80, initial_indent=' ', subsequent_indent=' ') - print(f"{index + 1}) {program['name']}\n{wrapped_description}\n") + name, description = _get_staking_name_description(program_id=key) + wrapped_description = textwrap.fill(description, width=80, initial_indent=' ', subsequent_indent=' ') + print(f"{index + 1}) {name}\n{wrapped_description}\n") while True: try: @@ -139,7 +102,7 @@ def _prompt_select_staking_program() -> str: except ValueError: print(f"Please enter a valid option (1 - {len(ids)}).") - print(f"Selected staking program: {STAKING_PROGRAMS[program_id]['name']}") + print(f"Selected staking program: {program_id}") print("") return program_id @@ -161,18 +124,54 @@ def _get_abi(contract_address: str) -> List: return abi if abi else [] -def _get_staking_env_variables(program_id: str) -> Dict[str, str]: - staking_program_data = STAKING_PROGRAMS.get(program_id) - +def _get_staking_token_contract(program_id: str) -> Any: with open(RPC_PATH, 'r', encoding="utf-8") as file: rpc = file.read().strip() w3 = Web3(Web3.HTTPProvider(rpc)) - staking_token_instance_address = staking_program_data["deployment"]["stakingTokenInstanceAddress"] # Instance/proxy - staking_token_address = staking_program_data["deployment"]["stakingTokenAddress"] # Implementation - abi = _get_abi(staking_token_address) - staking_token_contract = w3.eth.contract(address=staking_token_instance_address, abi=abi) + staking_token_instance_address = STAKING_PROGRAMS.get(program_id) + abi = _get_abi(staking_token_instance_address) + contract = w3.eth.contract(address=staking_token_instance_address, abi=abi) + + if 'getImplementation' in [func.fn_name for func in contract.all_functions()]: + # It is a proxy contract + implementation_address = contract.functions.getImplementation().call() + abi = _get_abi(implementation_address) + contract = w3.eth.contract(address=staking_token_instance_address, abi=abi) + + return contract + +def _get_staking_name_description(program_id: str) -> Tuple[str, str]: + + try: + if program_id == NO_STAKING_PROGRAM_ID: + return ( + "No staking", + "Your Olas Predict agent will still actively participate in prediction\ + markets, but it will not be staked within any staking program." + ) + + staking_token_contract = _get_staking_token_contract(program_id=program_id) + metadata_hash = staking_token_contract.functions.metadataHash().call() + ipfs_address = IPFS_ADDRESS.format(hash=metadata_hash.hex()) + response = requests.get(ipfs_address) + + if response.status_code == 200: + json_data = response.json() + return (json_data["name"], json_data["description"]) + + raise Exception(f"Failed to fetch data from {ipfs_address}: {response.status_code}") + except Exception: + return (program_id, program_id) + + +def _get_staking_env_variables(program_id: str) -> Dict[str, str]: + if program_id == NO_STAKING_PROGRAM_ID: + return NO_STAKING_PROGRAM_ENV_VARIABLES + + staking_token_instance_address = STAKING_PROGRAMS.get(program_id) + staking_token_contract = _get_staking_token_contract(program_id=program_id) agent_id = staking_token_contract.functions.agentIds(0).call() service_registry = staking_token_contract.functions.serviceRegistry().call() staking_token = staking_token_contract.functions.stakingToken().call() @@ -183,29 +182,29 @@ def _get_staking_env_variables(program_id: str) -> Dict[str, str]: if 'activityChecker' in [func.fn_name for func in staking_token_contract.all_functions()]: activity_checker = staking_token_contract.functions.activityChecker().call() abi = _get_abi(activity_checker) + + with open(RPC_PATH, 'r', encoding="utf-8") as file: + rpc = file.read().strip() + + w3 = Web3(Web3.HTTPProvider(rpc)) activity_checker_contract = w3.eth.contract(address=activity_checker, abi=abi) agent_mech = activity_checker_contract.functions.agentMech().call() else: activity_checker = ZERO_ADDRESS agent_mech = staking_token_contract.functions.agentMech().call() - if program_id == "no_staking": - use_staking = "false" - else: - use_staking = "true" - return { - "USE_STAKING": use_staking, + "USE_STAKING": "true", "STAKING_PROGRAM": program_id, - "CUSTOM_STAKING_ADDRESS": staking_token_instance_address, "AGENT_ID": agent_id, "CUSTOM_SERVICE_REGISTRY_ADDRESS": service_registry, - "CUSTOM_OLAS_ADDRESS": staking_token, "CUSTOM_SERVICE_REGISTRY_TOKEN_UTILITY_ADDRESS": service_registry_token_utility, + "CUSTOM_OLAS_ADDRESS": staking_token, + "CUSTOM_STAKING_ADDRESS": staking_token_instance_address, "MECH_ACTIVITY_CHECKER_CONTRACT": activity_checker, "MECH_CONTRACT_ADDRESS": agent_mech, + "MIN_STAKING_BOND_OLAS": min_staking_bond, "MIN_STAKING_DEPOSIT_OLAS": min_staking_deposit, - "MIN_STAKING_BOND_OLAS": min_staking_bond } @@ -268,11 +267,11 @@ def main() -> None: program_id = _prompt_select_staking_program() - print(" - Populating staking program variables in the .env file") + print(" - Populating staking program variables in the .env file") staking_env_variables = _get_staking_env_variables(program_id) _set_dotenv_file_variables(staking_env_variables) - print(" - Populating Nevermined variables in the .env file") + print(" - Populating Nevermined variables in the .env file") print("") nevermined_env_variables = _get_nevermined_env_variables() _set_dotenv_file_variables(nevermined_env_variables) diff --git a/scripts/staking.py b/scripts/staking.py index 5192264..e8b4e63 100644 --- a/scripts/staking.py +++ b/scripts/staking.py @@ -91,11 +91,10 @@ def _get_current_staking_program(ledger_api, service_id): all_staking_programs.update(DEPRECATED_STAKING_PROGRAMS) del all_staking_programs["no_staking"] del all_staking_programs["quickstart_alpha_everest"] # Very old program, not used likely - causes issues on "is_service_staked" - + staking_program = "no_staking" staking_contract_address = None - for program, data in all_staking_programs.items(): - address = data["deployment"]["stakingTokenInstanceAddress"] + for program, address in all_staking_programs.items(): if is_service_staked( ledger_api, service_id, address ): @@ -207,8 +206,10 @@ def _try_stake_service( available_rewards = get_available_rewards(ledger_api, staking_contract_address) if available_rewards == 0: # no rewards available, do nothing - print(f"No rewards available on the {current_program} staking program. Service {service_id} cannot be staked.") - sys.exit(0) + print(f"No rewards available on the {staking_program} staking program. Service {service_id} cannot be staked.") + print("Please choose another staking program.") + print("Terminating script.") + sys.exit(1) print( f"Rewards available: {available_rewards/10**18:.2f} OLAS. Staking service {service_id}..." @@ -268,19 +269,16 @@ def main() -> None: parser.add_argument("--password", type=str, help="Private key password") args = parser.parse_args() - staking_program = args.staking_contract_address env_file_vars = dotenv_values(DOTENV_PATH) target_program = env_file_vars.get("STAKING_PROGRAM") - print(f"Starting {Path(__file__).name} script ({staking_program})...\n") + print(f"Starting {Path(__file__).name} script ({target_program})...\n") ledger_api = EthereumApi(address=args.rpc) owner_crypto = EthereumCrypto( private_key_path=args.owner_private_key_path, password=args.password ) - - # -------------- # Unstaking flow # -------------- @@ -290,7 +288,7 @@ def main() -> None: service_id=args.service_id, owner_crypto=owner_crypto, ) - sys.exit(0) + return # -------------- # Staking flow @@ -341,7 +339,7 @@ def main() -> None: if is_staked: print( - f"Service {args.service_id} is already staked on {staking_program}. " + f"Service {args.service_id} is already staked on {target_program}. " f"Checking if the staking contract has any rewards..." ) else: @@ -351,7 +349,7 @@ def main() -> None: owner_crypto=owner_crypto, service_registry_address=args.service_registry_address, staking_contract_address=args.staking_contract_address, - staking_program=staking_program, + staking_program=target_program, ) except Exception as e: # pylint: disable=broad-except diff --git a/scripts/update_service.py b/scripts/update_service.py deleted file mode 100644 index b8e64c5..0000000 --- a/scripts/update_service.py +++ /dev/null @@ -1,204 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# ------------------------------------------------------------------------------ -# -# Copyright 2023 Valory AG -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# ------------------------------------------------------------------------------ - -"""This script updates the service.""" - -import argparse -import sys -import traceback -from pathlib import Path - -from aea_ledger_ethereum.ethereum import EthereumApi, EthereumCrypto -from autonomy.chain.base import UnitType, registry_contracts -from autonomy.chain.mint import sort_service_dependency_metadata -from autonomy.chain.config import ChainType, ContractConfigs -from aea.crypto.base import Crypto, LedgerApi -from typing import List -from math import ceil -from autonomy.chain.constants import ( - AGENT_REGISTRY_CONTRACT, - COMPONENT_REGISTRY_CONTRACT, - REGISTRIES_MANAGER_CONTRACT, - SERVICE_MANAGER_CONTRACT, - SERVICE_REGISTRY_CONTRACT, -) -from autonomy.chain.metadata import NFTHashOrPath, publish_metadata -from aea.configurations.loader import load_configuration_object -from aea.configurations.data_types import PackageType -from aea.helpers.base import IPFSHash - -from autonomy.configurations.base import PACKAGE_TYPE_TO_CONFIG_CLASS - -from utils import send_tx_and_wait_for_receipt - - -def update_service( # pylint: disable=too-many-arguments,too-many-locals - ledger_api: LedgerApi, - crypto: Crypto, - service_id: int, - nft: str, - chain_type: ChainType, - agent_ids: List[int], - number_of_slots_per_agent: List[int], - cost_of_bond_per_agent: List[int], - threshold: int, - token: str, - directory: Path, -) -> None: - """Publish component on-chain.""" - - package = load_configuration_object( - package_type=PackageType.SERVICE, - directory=directory, - package_type_config_class=PACKAGE_TYPE_TO_CONFIG_CLASS, - ) - metadata_hash, _ = publish_metadata( - package_id=package.package_id, - package_path=directory, - nft=IPFSHash(nft), - description=package.description, - ) - - if len(agent_ids) == 0: - raise ValueError("Please provide at least one agent id") - - if len(number_of_slots_per_agent) == 0: - raise ValueError("Please for provide number of slots for agents") - - if len(cost_of_bond_per_agent) == 0: - raise ValueError("Please for provide cost of bond for agents") - - if ( - len(agent_ids) != len(number_of_slots_per_agent) - or len(agent_ids) != len(cost_of_bond_per_agent) - or len(number_of_slots_per_agent) != len(cost_of_bond_per_agent) - ): - raise ValueError( - "Make sure the number of agent ids, number of slots for agents and cost of bond for agents match" - ) - - if any(map(lambda x: x == 0, number_of_slots_per_agent)): - raise ValueError("Number of slots cannot be zero") - - if any(map(lambda x: x == 0, cost_of_bond_per_agent)): - raise ValueError("Cost of bond cannot be zero") - - number_of_agent_instances = sum(number_of_slots_per_agent) - if threshold < (ceil((number_of_agent_instances * 2 + 1) / 3)): - raise ValueError( - "The threshold value should at least be greater than or equal to ceil((n * 2 + 1) / 3), " - "n is total number of agent instances in the service" - ) - - ( - agent_ids, - number_of_slots_per_agent, - cost_of_bond_per_agent, - ) = sort_service_dependency_metadata( - agent_ids=agent_ids, - number_of_slots_per_agents=number_of_slots_per_agent, - cost_of_bond_per_agent=cost_of_bond_per_agent, - ) - - agent_params = [ - [n, c] for n, c in zip(number_of_slots_per_agent, cost_of_bond_per_agent) - ] - - tx = registry_contracts.service_manager.get_update_transaction( - ledger_api=ledger_api, - contract_address=ContractConfigs.get(SERVICE_MANAGER_CONTRACT.name).contracts[ - chain_type - ], - service_id=service_id, - sender=crypto.address, - metadata_hash=metadata_hash, - agent_ids=agent_ids, - agent_params=agent_params, - threshold=threshold, - token=token, - raise_on_try=True, - ) - - send_tx_and_wait_for_receipt(ledger_api, crypto, tx) - - -if __name__ == "__main__": - try: - print(f" - Starting {Path(__file__).name} script...") - - parser = argparse.ArgumentParser(description="Update the service.") - parser.add_argument( - "owner_private_key_path", - type=str, - help="Path to the file containing the service owner's Ethereum private key", - ) - parser.add_argument( - "nft", - type=str, - help="The nft to be used.", - ) - parser.add_argument( - "agent_id", - type=int, - help="The service registry contract address.", - ) - parser.add_argument( - "service_id", - type=int, - help="The service id.", - ) - parser.add_argument( - "token", - type=str, - help="The token address to be used.", - ) - parser.add_argument( - "bond_amount", - type=int, - help="The bond amount.", - ) - parser.add_argument( - "directory", - type=str, - help="The directory of the service package.", - ) - parser.add_argument("rpc", type=str, help="RPC for the Gnosis chain") - parser.add_argument("--password", type=str, help="Private key password") - args = parser.parse_args() - ledger_api = EthereumApi(address=args.rpc) - owner_crypto = EthereumCrypto(private_key_path=args.owner_private_key_path, password=args.password) - update_service( - ledger_api=ledger_api, - crypto=owner_crypto, - service_id=args.service_id, - nft=args.nft, - chain_type=ChainType.CUSTOM, - agent_ids=[args.agent_id], - number_of_slots_per_agent=[1], - cost_of_bond_per_agent=[args.bond_amount], - threshold=1, - token=args.token, - directory=Path(args.directory), - ) - print(f"Service {args.service_id} updated successfully.") - except Exception as e: # pylint: disable=broad-except - print(f"An error occurred while executing {Path(__file__).name}: {str(e)}") - traceback.print_exc() - sys.exit(1) diff --git a/scripts/utils.py b/scripts/utils.py index bb3dbc7..dead311 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -69,7 +69,7 @@ GAS_PARAMS = { "maxFeePerGas": 30_000_000_000, "maxPriorityFeePerGas": 3_000_000_000, - "gas": 500_000, + "gas": 5_000_000, } def load_contract(ctype: ContractType) -> ContractType: From 3aed8d85ca444e1ed40a898c2631df7b0ef2e14d Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Sat, 24 Aug 2024 21:31:46 +0200 Subject: [PATCH 04/11] chore: fix bond computation --- run_service.sh | 12 ++----- scripts/choose_staking.py | 36 +++++++++++++-------- scripts/get_agent_bond.py | 68 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 22 deletions(-) create mode 100644 scripts/get_agent_bond.py diff --git a/run_service.sh b/run_service.sh index 419cd14..22c5812 100755 --- a/run_service.sh +++ b/run_service.sh @@ -280,14 +280,6 @@ get_on_chain_agent_ids() { echo "$agent_ids" } -get_on_chain_agent_bond() { - local service_id="$1" - local service_info=$(poetry run autonomy service --use-custom-chain info "$service_id") - local on_chain_deposit="$(echo "$service_info" | awk '/Security Deposit/ {sub(/\|[ \t]*Security Deposit[ \t]*\|[ \t]*/, ""); sub(/[ \t]*\|[ \t]*/, ""); print}')" - on_chain_agent_bond=$($PYTHON_CMD -c "print(int(float('$on_chain_deposit')))") - echo "$on_chain_agent_bond" -} - # Move a file if it exists move_if_exists() { local source_file="$1" @@ -887,7 +879,9 @@ local_service_hash="$(grep 'service/valory/trader' $packages | awk -F: '{print $ remote_service_hash=$(poetry run python "../scripts/service_hash.py") operator_address=$(get_address "../$operator_keys_file") on_chain_agent_id=$(get_on_chain_agent_ids "$service_id") -on_chain_agent_bond=$(get_on_chain_agent_bond "$service_id") + +# On-chain agent bond for the expected agent ID ($AGENT_ID) +on_chain_agent_bond=$(poetry run python "../scripts/get_agent_bond.py" "$CUSTOM_SERVICE_REGISTRY_TOKEN_UTILITY_ADDRESS" "$service_id" "$AGENT_ID" "$rpc") if [ "${USE_STAKING}" = true ]; then cost_of_bonding=$MIN_STAKING_BOND_OLAS diff --git a/scripts/choose_staking.py b/scripts/choose_staking.py index bb27238..06cb103 100644 --- a/scripts/choose_staking.py +++ b/scripts/choose_staking.py @@ -27,7 +27,6 @@ from pathlib import Path from typing import Any, Dict, List, Tuple from web3 import Web3 -from eth_utils import keccak SCRIPT_PATH = Path(__file__).resolve().parent STORE_PATH = Path(SCRIPT_PATH, "..", ".trader_runner") @@ -41,6 +40,11 @@ ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" DEPRECATED_TEXT = "(DEPRECATED)" NO_STAKING_PROGRAM_ID = "no_staking" +NO_STAKING_PROGRAM_METADATA = { + "name": "No staking", + "description": "Your Olas Predict agent will still actively participate in prediction\ + markets, but it will not be staked within any staking program.", +} NO_STAKING_PROGRAM_ENV_VARIABLES = { "USE_STAKING": "false", "STAKING_PROGRAM": NO_STAKING_PROGRAM_ID, @@ -61,12 +65,12 @@ NO_STAKING_PROGRAM_ID: ZERO_ADDRESS, "quickstart_beta_hobbyist": "0x389B46c259631Acd6a69Bde8B6cEe218230bAE8C", "quickstart_beta_expert": "0x5344B7DD311e5d3DdDd46A4f71481bD7b05AAA3e", - "quickstart_alpha_coastal": "0x43fB32f25dce34EB76c78C7A42C8F40F84BCD237", } DEPRECATED_STAKING_PROGRAMS = { "quickstart_alpha_everest": "0x5add592ce0a1B5DceCebB5Dcac086Cd9F9e3eA5C", "quickstart_alpha_alpine": "0x2Ef503950Be67a98746F484DA0bBAdA339DF3326", + "quickstart_alpha_coastal": "0x43fB32f25dce34EB76c78C7A42C8F40F84BCD237", } @@ -88,7 +92,9 @@ def _prompt_select_staking_program() -> str: print("----------------------------------------------") ids = list(STAKING_PROGRAMS.keys()) for index, key in enumerate(ids): - name, description = _get_staking_name_description(program_id=key) + metadata = _get_staking_contract_metadata(program_id=key) + name = metadata["name"] + description = metadata["description"] wrapped_description = textwrap.fill(description, width=80, initial_indent=' ', subsequent_indent=' ') print(f"{index + 1}) {name}\n{wrapped_description}\n") @@ -124,7 +130,13 @@ def _get_abi(contract_address: str) -> List: return abi if abi else [] +contracts_cache: Dict[str, Any] = {} + + def _get_staking_token_contract(program_id: str) -> Any: + if program_id in contracts_cache: + return contracts_cache[program_id] + with open(RPC_PATH, 'r', encoding="utf-8") as file: rpc = file.read().strip() @@ -139,18 +151,14 @@ def _get_staking_token_contract(program_id: str) -> Any: abi = _get_abi(implementation_address) contract = w3.eth.contract(address=staking_token_instance_address, abi=abi) + contracts_cache[program_id] = contract return contract -def _get_staking_name_description(program_id: str) -> Tuple[str, str]: - +def _get_staking_contract_metadata(program_id: str) -> Dict[str, str]: try: if program_id == NO_STAKING_PROGRAM_ID: - return ( - "No staking", - "Your Olas Predict agent will still actively participate in prediction\ - markets, but it will not be staked within any staking program." - ) + return NO_STAKING_PROGRAM_METADATA staking_token_contract = _get_staking_token_contract(program_id=program_id) metadata_hash = staking_token_contract.functions.metadataHash().call() @@ -158,12 +166,14 @@ def _get_staking_name_description(program_id: str) -> Tuple[str, str]: response = requests.get(ipfs_address) if response.status_code == 200: - json_data = response.json() - return (json_data["name"], json_data["description"]) + return response.json() raise Exception(f"Failed to fetch data from {ipfs_address}: {response.status_code}") except Exception: - return (program_id, program_id) + return { + "name": program_id, + "description": program_id, + } def _get_staking_env_variables(program_id: str) -> Dict[str, str]: diff --git a/scripts/get_agent_bond.py b/scripts/get_agent_bond.py new file mode 100644 index 0000000..58ee078 --- /dev/null +++ b/scripts/get_agent_bond.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2022-2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +import argparse +import requests +import json +import sys +from typing import List +from web3 import Web3 + + +def _get_abi(contract_address: str) -> List: + contract_abi_url = "https://gnosis.blockscout.com/api/v2/smart-contracts/{contract_address}" + response = requests.get(contract_abi_url.format(contract_address=contract_address)).json() + + if "result" in response: + result = response["result"] + try: + abi = json.loads(result) + except json.JSONDecodeError: + print("Error: Failed to parse 'result' field as JSON") + sys.exit(1) + else: + abi = response.get("abi") + + return abi if abi else [] + + +def main() -> None: + parser = argparse.ArgumentParser(description="Get agent bond from service registry token utility contract.") + parser.add_argument('contract_address', type=str, help='Service registry token utility contract address') + parser.add_argument('service_id', type=int, help='Service ID') + parser.add_argument('agent_id', type=int, help='Agent ID') + parser.add_argument('rpc', type=str, help='RPC') + args = parser.parse_args() + + contract_address = args.contract_address + service_id = args.service_id + agent_id = args.agent_id + rpc = args.rpc + + w3 = Web3(Web3.HTTPProvider(rpc)) + abi = _get_abi(contract_address) + contract = w3.eth.contract(address=contract_address, abi=abi) + agent_bond = contract.functions.getAgentBond(service_id, agent_id).call() + + print(agent_bond) + + +if __name__ == "__main__": + main() From 310445630f079936c942ba712057a1bbb9523f3c Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Sun, 25 Aug 2024 11:21:50 +0200 Subject: [PATCH 05/11] fix: balance computation --- run_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_service.sh b/run_service.sh index 22c5812..9495beb 100755 --- a/run_service.sh +++ b/run_service.sh @@ -78,7 +78,7 @@ ensure_minimum_balance() { if [ "$cycle_count" -eq 100 ]; then balance_hex=$(get_balance "$address") balance=$(hex_to_decimal "$balance_hex") - balance=$((erc20_balance+balance)) + balance=$($PYTHON_CMD -c "print(int($balance) + int($erc20_balance))") cycle_count=0 fi done From 646e07f9d61b92f7eb275af3595a207c98d37c6d Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Sun, 25 Aug 2024 11:22:16 +0200 Subject: [PATCH 06/11] chore: minor script fixes --- scripts/staking.py | 13 ++++++++----- scripts/utils.py | 3 +-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/staking.py b/scripts/staking.py index e8b4e63..05b8a7f 100644 --- a/scripts/staking.py +++ b/scripts/staking.py @@ -30,7 +30,11 @@ import dotenv from aea_ledger_ethereum.ethereum import EthereumApi, EthereumCrypto -from choose_staking import STAKING_PROGRAMS, DEPRECATED_STAKING_PROGRAMS +from choose_staking import ( + STAKING_PROGRAMS, + DEPRECATED_STAKING_PROGRAMS, + NO_STAKING_PROGRAM_ID, +) from utils import ( get_available_rewards, get_available_staking_slots, @@ -89,10 +93,10 @@ def _check_unstaking_availability( def _get_current_staking_program(ledger_api, service_id): all_staking_programs = STAKING_PROGRAMS.copy() all_staking_programs.update(DEPRECATED_STAKING_PROGRAMS) - del all_staking_programs["no_staking"] + del all_staking_programs[NO_STAKING_PROGRAM_ID] del all_staking_programs["quickstart_alpha_everest"] # Very old program, not used likely - causes issues on "is_service_staked" - staking_program = "no_staking" + staking_program = NO_STAKING_PROGRAM_ID staking_contract_address = None for program, address in all_staking_programs.items(): if is_service_staked( @@ -294,8 +298,7 @@ def main() -> None: # Staking flow # -------------- current_staking_contract_address, current_program = _get_current_staking_program(ledger_api, args.service_id) - is_staked = current_program != "no_staking" - + is_staked = current_program != NO_STAKING_PROGRAM_ID if is_staked and current_program != target_program: print( diff --git a/scripts/utils.py b/scripts/utils.py index dead311..fd1f805 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -61,7 +61,6 @@ DEFAULT_ON_CHAIN_INTERACT_SLEEP = 6.0 -ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" ZERO_ETH = 0 ContractType = typing.TypeVar("ContractType") @@ -69,7 +68,7 @@ GAS_PARAMS = { "maxFeePerGas": 30_000_000_000, "maxPriorityFeePerGas": 3_000_000_000, - "gas": 5_000_000, + "gas": 500_000, } def load_contract(ctype: ContractType) -> ContractType: From be0158f34f80b158f4186efed7b0a45761441bd5 Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Sun, 25 Aug 2024 11:24:37 +0200 Subject: [PATCH 07/11] chore: display git information on script --- run_service.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/run_service.sh b/run_service.sh index 9495beb..2541ecf 100755 --- a/run_service.sh +++ b/run_service.sh @@ -673,6 +673,12 @@ echo "" echo "This script will assist you in setting up and running the Trader service ($service_repo)." echo "" +# Display information of the Git repository +current_branch=$(git rev-parse --abbrev-ref HEAD) +latest_commit_hash=$(git rev-parse HEAD) +echo "Current branch: $current_branch" +echo "Commit hash: $latest_commit_hash" + # Check the command-line arguments while [[ "$#" -gt 0 ]]; do case $1 in From 87915d020297739bc52330f67e97a8a416602e6b Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Sun, 25 Aug 2024 11:40:48 +0200 Subject: [PATCH 08/11] chore: fix message --- scripts/staking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/staking.py b/scripts/staking.py index 05b8a7f..15464b8 100644 --- a/scripts/staking.py +++ b/scripts/staking.py @@ -216,7 +216,7 @@ def _try_stake_service( sys.exit(1) print( - f"Rewards available: {available_rewards/10**18:.2f} OLAS. Staking service {service_id}..." + f"Rewards available on {staking_program}: {available_rewards/10**18:.2f} OLAS. Staking service {service_id}..." ) stake_txs = get_stake_txs( ledger_api, From 8abc802387fb54d958e868fb66ca374c428a452a Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Sun, 25 Aug 2024 13:28:13 +0200 Subject: [PATCH 09/11] chore: remove duplicate code --- contracts/ServiceRegistryL2.json | 1899 ------------------------------ scripts/service_hash.py | 12 +- scripts/staking.py | 10 + 3 files changed, 19 insertions(+), 1902 deletions(-) delete mode 100644 contracts/ServiceRegistryL2.json diff --git a/contracts/ServiceRegistryL2.json b/contracts/ServiceRegistryL2.json deleted file mode 100644 index 0054fd2..0000000 --- a/contracts/ServiceRegistryL2.json +++ /dev/null @@ -1,1899 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "ServiceRegistryL2", - "sourceName": "contracts/ServiceRegistryL2.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "_baseURI", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "AgentInstanceRegistered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "AgentInstancesSlotsFilled", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "agentId", - "type": "uint256" - } - ], - "name": "AgentNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "agentId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "AgentNotInService", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "componentId", - "type": "uint256" - } - ], - "name": "ComponentNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "HashExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "IncorrectAgentBondingValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "IncorrectRegistrationDepositValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "manager", - "type": "address" - } - ], - "name": "ManagerOnly", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "provided", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "OnlyOwnServiceMultisig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "OperatorHasNoInstances", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "provided", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "Overflow", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnerOnly", - "type": "error" - }, - { - "inputs": [], - "name": "Paused", - "type": "error" - }, - { - "inputs": [], - "name": "ReentrancyGuard", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "ServiceMustBeInactive", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "TransferFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "multisig", - "type": "address" - } - ], - "name": "UnauthorizedMultisig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "agentId", - "type": "uint256" - } - ], - "name": "WrongAgentId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "numValues1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "numValues2", - "type": "uint256" - } - ], - "name": "WrongArrayLength", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "WrongOperator", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "state", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "WrongServiceState", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentThreshold", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minThreshold", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxThreshold", - "type": "uint256" - } - ], - "name": "WrongThreshold", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroValue", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "ActivateRegistration", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "baseURI", - "type": "string" - } - ], - "name": "BaseURIChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "multisig", - "type": "address" - } - ], - "name": "CreateMultisigWithAgents", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "configHash", - "type": "bytes32" - } - ], - "name": "CreateService", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "DeployService", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "drainer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Drain", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "drainer", - "type": "address" - } - ], - "name": "DrainerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - } - ], - "name": "ManagerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "OperatorSlashed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "OperatorUnbond", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Refund", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "agentInstance", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "agentId", - "type": "uint256" - } - ], - "name": "RegisterInstance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "TerminateService", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "configHash", - "type": "bytes32" - } - ], - "name": "UpdateService", - "type": "event" - }, - { - "inputs": [], - "name": "CID_PREFIX", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceOwner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "activateRegistration", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "baseURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDrainer", - "type": "address" - } - ], - "name": "changeDrainer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "changeManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "multisig", - "type": "address" - }, - { - "internalType": "bool", - "name": "permission", - "type": "bool" - } - ], - "name": "changeMultisigPermission", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "changeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "configHash", - "type": "bytes32" - }, - { - "internalType": "uint32[]", - "name": "agentIds", - "type": "uint32[]" - }, - { - "components": [ - { - "internalType": "uint32", - "name": "slots", - "type": "uint32" - }, - { - "internalType": "uint96", - "name": "bond", - "type": "uint96" - } - ], - "internalType": "struct AgentParams[]", - "name": "agentParams", - "type": "tuple[]" - }, - { - "internalType": "uint32", - "name": "threshold", - "type": "uint32" - } - ], - "name": "create", - "outputs": [ - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceOwner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "multisigImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "deploy", - "outputs": [ - { - "internalType": "address", - "name": "multisig", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "drain", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "drainer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "unitId", - "type": "uint256" - } - ], - "name": "exists", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "getAgentInstances", - "outputs": [ - { - "internalType": "uint256", - "name": "numAgentInstances", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "agentInstances", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "getAgentParams", - "outputs": [ - { - "internalType": "uint256", - "name": "numAgentIds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint32", - "name": "slots", - "type": "uint32" - }, - { - "internalType": "uint96", - "name": "bond", - "type": "uint96" - } - ], - "internalType": "struct AgentParams[]", - "name": "agentParams", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "agentId", - "type": "uint256" - } - ], - "name": "getInstancesForAgentId", - "outputs": [ - { - "internalType": "uint256", - "name": "numAgentInstances", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "agentInstances", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "getOperatorBalance", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "getPreviousHashes", - "outputs": [ - { - "internalType": "uint256", - "name": "numHashes", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "configHashes", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "getService", - "outputs": [ - { - "components": [ - { - "internalType": "uint96", - "name": "securityDeposit", - "type": "uint96" - }, - { - "internalType": "address", - "name": "multisig", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "configHash", - "type": "bytes32" - }, - { - "internalType": "uint32", - "name": "threshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxNumAgentInstances", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "numAgentInstances", - "type": "uint32" - }, - { - "internalType": "enum ServiceRegistryL2.ServiceState", - "name": "state", - "type": "uint8" - }, - { - "internalType": "uint32[]", - "name": "agentIds", - "type": "uint32[]" - } - ], - "internalType": "struct ServiceRegistryL2.Service", - "name": "service", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "mapAgentInstanceOperators", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "mapConfigHashes", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "mapMultisigs", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "mapOperatorAndServiceIdAgentInstances", - "outputs": [ - { - "internalType": "address", - "name": "instance", - "type": "address" - }, - { - "internalType": "uint32", - "name": "agentId", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "mapOperatorAndServiceIdOperatorBalances", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "mapServiceAndAgentIdAgentInstances", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "mapServiceAndAgentIdAgentParams", - "outputs": [ - { - "internalType": "uint32", - "name": "slots", - "type": "uint32" - }, - { - "internalType": "uint96", - "name": "bond", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "mapServices", - "outputs": [ - { - "internalType": "uint96", - "name": "securityDeposit", - "type": "uint96" - }, - { - "internalType": "address", - "name": "multisig", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "configHash", - "type": "bytes32" - }, - { - "internalType": "uint32", - "name": "threshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxNumAgentInstances", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "numAgentInstances", - "type": "uint32" - }, - { - "internalType": "enum ServiceRegistryL2.ServiceState", - "name": "state", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "agentInstances", - "type": "address[]" - }, - { - "internalType": "uint32[]", - "name": "agentIds", - "type": "uint32[]" - } - ], - "name": "registerAgents", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "bURI", - "type": "string" - } - ], - "name": "setBaseURI", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "agentInstances", - "type": "address[]" - }, - { - "internalType": "uint96[]", - "name": "amounts", - "type": "uint96[]" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "slash", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "slashedFunds", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceOwner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "terminate", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "refund", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "unitId", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "unitId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "unbond", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "refund", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceOwner", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "configHash", - "type": "bytes32" - }, - { - "internalType": "uint32[]", - "name": "agentIds", - "type": "uint32[]" - }, - { - "components": [ - { - "internalType": "uint32", - "name": "slots", - "type": "uint32" - }, - { - "internalType": "uint96", - "name": "bond", - "type": "uint96" - } - ], - "internalType": "struct AgentParams[]", - "name": "agentParams", - "type": "tuple[]" - }, - { - "internalType": "uint32", - "name": "threshold", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "serviceId", - "type": "uint256" - } - ], - "name": "update", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x60806040526001600a553480156200001657600080fd5b5060405162005bcb38038062005bcb83398101604081905262000039916200014d565b828260006200004983826200026d565b5060016200005882826200026d565b50600891506200006b905082826200026d565b5050600680546001600160a01b0319163317905550620003399050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000b057600080fd5b81516001600160401b0380821115620000cd57620000cd62000088565b604051601f8301601f19908116603f01168101908282118183101715620000f857620000f862000088565b816040528381526020925086838588010111156200011557600080fd5b600091505b838210156200013957858201830151818301840152908201906200011a565b600093810190920192909252949350505050565b6000806000606084860312156200016357600080fd5b83516001600160401b03808211156200017b57600080fd5b62000189878388016200009e565b94506020860151915080821115620001a057600080fd5b620001ae878388016200009e565b93506040860151915080821115620001c557600080fd5b50620001d4868287016200009e565b9150509250925092565b600181811c90821680620001f357607f821691505b6020821081036200021457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200026857600081815260208120601f850160051c81016020861015620002435750805b601f850160051c820191505b8181101562000264578281556001016200024f565b5050505b505050565b81516001600160401b0381111562000289576200028962000088565b620002a1816200029a8454620001de565b846200021a565b602080601f831160018114620002d95760008415620002c05750858301515b600019600386901b1c1916600185901b17855562000264565b600085815260208120601f198616915b828110156200030a57888601518255948401946001909101908401620002e9565b5085821015620003295787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61588280620003496000396000f3fe6080604052600436106103345760003560e01c806370a08231116101b0578063a60e4c3c116100ec578063dff7672411610095578063ef0e239b1161006f578063ef0e239b14610af7578063f908bc7714610b24578063fbdeb3d714610b44578063ffa1ad7414610b6457600080fd5b8063dff7672414610a96578063e23f6fb414610aa9578063e985e9c514610abc57600080fd5b8063c87b56dd116100c6578063c87b56dd14610a36578063cbf994f814610a56578063ccc9305d14610a7657600080fd5b8063a60e4c3c146109c8578063a6f9dae1146109f6578063b88d4fde14610a1657600080fd5b80638a2bd86f116101595780639890220b116101335780639890220b1461093c578063a22cb46514610951578063a3fbbaae14610971578063a5d059ca1461099157600080fd5b80638a2bd86f146108c25780638da5cb5b1461090757806395d89b411461092757600080fd5b80637c5e63e01161018a5780637c5e63e01461084d57806382694b1d1461088257806386a2bdd4146108a257600080fd5b806370a08231146107c9578063718934d8146107e957806373b8b6a21461082d57600080fd5b806342842e0e1161027f57806355f804b3116102285780636352211e116102025780636352211e1461070a57806363dd76151461072a5780636c0360eb146107945780636f99f15c146107a957600080fd5b806355f804b3146106a357806357838e85146106c35780635e4507fa146106ea57600080fd5b80634eb780da116102595780634eb780da1461062d5780634f558e79146106635780634f6ccce71461068357600080fd5b806342842e0e146105cd578063481c6a75146105ed5780634d486f851461060d57600080fd5b806318160ddd116102e157806323b872dd116102bb57806323b872dd146104d057806342144854146104f05780634236aff81461053e57600080fd5b806318160ddd146104505780631de286ba1461047457806321e4f7bb146104a257600080fd5b8063095ea7b311610312578063095ea7b3146103de57806310c6aa191461040057806317351f7e1461042057600080fd5b806301ffc9a71461033957806306fdde031461036e578063081812fc14610390575b600080fd5b34801561034557600080fd5b506103596103543660046149a2565b610b95565b60405190151581526020015b60405180910390f35b34801561037a57600080fd5b50610383610be7565b6040516103659190614a16565b34801561039c57600080fd5b506103c66103ab366004614a29565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610365565b3480156103ea57600080fd5b506103fe6103f9366004614a57565b610c75565b005b34801561040c57600080fd5b506103fe61041b366004614a83565b610d5c565b34801561042c57600080fd5b5061035961043b366004614a83565b60126020526000908152604090205460ff1681565b34801561045c57600080fd5b5061046660095481565b604051908152602001610365565b34801561048057600080fd5b5061049461048f366004614a29565b610e15565b604051610365929190614aa0565b3480156104ae57600080fd5b506104c26104bd366004614b07565b61106b565b604051610365929190614b6d565b3480156104dc57600080fd5b506103fe6104eb366004614b8e565b611159565b3480156104fc57600080fd5b5061052661050b366004614a29565b6010602052600090815260409020546001600160601b031681565b6040516001600160601b039091168152602001610365565b34801561054a57600080fd5b506105ba610559366004614a29565b6013602052600090815260409020805460018201546002909201546001600160601b03821692600160601b928390046001600160a01b031692909163ffffffff808216926401000000008304821692600160401b8104909216910460ff1687565b6040516103659796959493929190614c07565b3480156105d957600080fd5b506103fe6105e8366004614b8e565b611333565b3480156105f957600080fd5b506007546103c6906001600160a01b031681565b34801561061957600080fd5b506104c2610628366004614a29565b611428565b34801561063957600080fd5b506103c6610648366004614a83565b6011602052600090815260409020546001600160a01b031681565b34801561066f57600080fd5b5061035961067e366004614a29565b61157a565b34801561068f57600080fd5b5061046661069e366004614a29565b61159c565b3480156106af57600080fd5b506103fe6106be366004614d2a565b6115e1565b3480156106cf57600080fd5b50600b546103c690600160601b90046001600160a01b031681565b3480156106f657600080fd5b506103c6610705366004614b07565b61168a565b34801561071657600080fd5b506103c6610725366004614a29565b6116c2565b34801561073657600080fd5b50610770610745366004614a29565b600e6020526000908152604090205463ffffffff81169064010000000090046001600160601b031682565b6040805163ffffffff90931683526001600160601b03909116602083015201610365565b3480156107a057600080fd5b50610383611727565b3480156107b557600080fd5b50600b54610526906001600160601b031681565b3480156107d557600080fd5b506104666107e4366004614a83565b611734565b3480156107f557600080fd5b50610809610804366004614b07565b6117a8565b604080516001600160a01b03909316835263ffffffff909116602083015201610365565b34801561083957600080fd5b50610359610848366004614e22565b6117ee565b34801561085957600080fd5b506103836040518060400160405280600981526020016806630313730313232360bc1b81525081565b34801561088e57600080fd5b5061035961089d366004614eec565b611c43565b3480156108ae57600080fd5b506104666108bd366004614b07565b611cdc565b3480156108ce57600080fd5b506104666108dd366004614a57565b60a01b6001600160a01b03909116176000908152601060205260409020546001600160601b031690565b34801561091357600080fd5b506006546103c6906001600160a01b031681565b34801561093357600080fd5b50610383611d0d565b34801561094857600080fd5b50610466611d1a565b34801561095d57600080fd5b506103fe61096c366004614eec565b611e78565b34801561097d57600080fd5b506103fe61098c366004614a83565b611ee4565b34801561099d57600080fd5b506109b16109ac366004614a57565b611f95565b604080519215158352602083019190915201610365565b3480156109d457600080fd5b506109e86109e3366004614a29565b612431565b604051610365929190614f2a565b348015610a0257600080fd5b506103fe610a11366004614a83565b612495565b348015610a2257600080fd5b506103fe610a31366004614f78565b612546565b348015610a4257600080fd5b50610383610a51366004614a29565b61262b565b348015610a6257600080fd5b50610359610a7136600461511a565b6126a5565b348015610a8257600080fd5b506109b1610a91366004614a57565b612c33565b610359610aa43660046151b3565b612f95565b610359610ab7366004614a57565b613590565b348015610ac857600080fd5b50610359610ad7366004615233565b600560209081526000928352604080842090915290825290205460ff1681565b348015610b0357600080fd5b50610b17610b12366004614a29565b61370f565b6040516103659190615297565b348015610b3057600080fd5b506103c6610b3f366004615333565b61388f565b348015610b5057600080fd5b50610466610b5f3660046153a7565b613c60565b348015610b7057600080fd5b50610383604051806040016040528060058152602001640312e302e360dc1b81525081565b60006301ffc9a760e01b6001600160e01b031983161480610bc657506380ac58cd60e01b6001600160e01b03198316145b80610be15750635b5e139f60e01b6001600160e01b03198316145b92915050565b60008054610bf490615438565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2090615438565b8015610c6d5780601f10610c4257610100808354040283529160200191610c6d565b820191906000526020600020905b815481529060010190602001808311610c5057829003601f168201915b505050505081565b6000818152600260205260409020546001600160a01b031633811480610cbe57506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b610d005760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6006546001600160a01b03163314610d9c5760065460405163521eb56d60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b038116610dc35760405163d92e233d60e01b815260040160405180910390fd5b600b80546001600160601b0316600160601b6001600160a01b038416908102919091179091556040517f8d1e8547016120917daad7f81c42b48f7fee379badc48f1889f0f43bb619472590600090a250565b600081815260136020908152604080832081516101008101835281546001600160601b03811682526001600160a01b03600160601b918290041694820194909452600182015492810192909252600281015463ffffffff808216606085810191909152640100000000830482166080860152600160401b830490911660a0850152938593929160c084019160ff9104166005811115610eb657610eb6614bcf565b6005811115610ec757610ec7614bcf565b815260200160038201805480602002602001604051908101604052809291908181526020018280548015610f4657602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411610f095790505b50505050508152505090508060e001515192508267ffffffffffffffff811115610f7257610f72614c62565b604051908082528060200260200182016040528015610fb757816020015b6040805180820190915260008082526020820152815260200190600190039081610f905790505b50915060005b8381101561106457600085905060208360e001518381518110610fe257610fe2615472565b60209081029190910181015163ffffffff90811690921b929092176000818152600e845260409081902081518083019092525492831681526401000000009092046001600160601b031692820192909252845185908490811061104757611047615472565b6020026020010181905250508061105d9061549e565b9050610fbd565b5050915091565b602081811b83176000818152600f909252604090912054906060908267ffffffffffffffff81111561109f5761109f614c62565b6040519080825280602002602001820160405280156110c8578160200160208202803683370190505b50915060005b83811015611150576000828152600f602052604090208054829081106110f6576110f6615472565b9060005260206000200160009054906101000a90046001600160a01b031683828151811061112657611126615472565b6001600160a01b0390921660209283029190910190910152806111488161549e565b9150506110ce565b50509250929050565b6000818152600260205260409020546001600160a01b038481169116146111c25760405162461bcd60e51b815260206004820152600a60248201527f57524f4e475f46524f4d000000000000000000000000000000000000000000006044820152606401610cf7565b6001600160a01b03821661120c5760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b6044820152606401610cf7565b336001600160a01b038416148061124657506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b8061126757506000818152600460205260409020546001600160a01b031633145b6112a45760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b6044820152606401610cf7565b6001600160a01b0380841660008181526003602090815260408083208054600019019055938616808352848320805460010190558583526002825284832080546001600160a01b03199081168317909155600490925284832080549092169091559251849392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61133e838383611159565b6001600160a01b0382163b1561142357604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af11580156113b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d991906154b7565b6001600160e01b031916146114235760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b6044820152606401610cf7565b505050565b600081815260136020908152604080832081516101008101835281546001600160601b03811682526001600160a01b03600160601b918290041694820194909452600182015492810192909252600281015463ffffffff808216606085810191909152640100000000830482166080860152600160401b830490911660a0850152938593929160c084019160ff91041660058111156114c9576114c9614bcf565b60058111156114da576114da614bcf565b81526020016003820180548060200260200160405190810160405280929190818152602001828054801561155957602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff168152602001906004019060208260030104928301926001038202915080841161151c5790505b505050505081525050905061156e8185613f67565b91508151925050915091565b60008082118015610be157506009546115949060016154d4565b821092915050565b60006115a98260016154d4565b90506009548111156115dc57600954604051637ae5968560e01b8152610cf7918391600401918252602082015260400190565b919050565b6006546001600160a01b031633146116215760065460405163521eb56d60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b805160000361164357604051637c946ed760e01b815260040160405180910390fd5b600861164f8282615535565b507f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf68160405161167f9190614a16565b60405180910390a150565b600f60205281600052604060002081815481106116a657600080fd5b6000918252602090912001546001600160a01b03169150829050565b6000818152600260205260409020546001600160a01b0316806115dc5760405162461bcd60e51b815260206004820152600a60248201527f4e4f545f4d494e544544000000000000000000000000000000000000000000006044820152606401610cf7565b60088054610bf490615438565b60006001600160a01b03821661178c5760405162461bcd60e51b815260206004820152600c60248201527f5a45524f5f4144445245535300000000000000000000000000000000000000006044820152606401610cf7565b506001600160a01b031660009081526003602052604090205490565b600d60205281600052604060002081815481106117c457600080fd5b6000918252602090912001546001600160a01b0381169250600160a01b900463ffffffff16905082565b600081815260136020908152604080832081516101008101835281546001600160601b0381168252600160601b908190046001600160a01b031694820194909452600182015492810192909252600281015463ffffffff8082166060850152640100000000820481166080850152600160401b82041660a0840152849360c08401910460ff16600581111561188557611885614bcf565b600581111561189657611896614bcf565b81526020016003820180548060200260200160405190810160405280929190818152602001828054801561191557602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116118d85790505b50505050508152505090506004600581111561193357611933614bcf565b8160c00151600581111561194957611949614bcf565b14611988578060c00151600581111561196457611964614bcf565b604051633c053f9d60e21b8152600481019190915260248101849052604401610cf7565b83518551146119b757845184516040516308151c1160e41b815260048101929092526024820152604401610cf7565b80602001516001600160a01b0316336001600160a01b031614611a0b5760208101516040516379f91cd360e01b81523360048201526001600160a01b03909116602482015260448101849052606401610cf7565b845160005b81811015611c3657600060116000898481518110611a3057611a30615472565b6020908102919091018101516001600160a01b03908116835282820193909352604091820160009081205490931660a08a901b81178085526010909252919092205489519193506001600160601b03169081908a9086908110611a9557611a95615472565b60200260200101516001611aa991906155f5565b6001600160601b03161115611b0357600b8054829190600090611ad69084906001600160601b03166155f5565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555060009050611b87565b888481518110611b1557611b15615472565b6020908102919091010151600b8054600090611b3b9084906001600160601b03166155f5565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550888481518110611b7157611b71615472565b602002602001015181611b84919061561c565b90505b600082815260106020526040902080546bffffffffffffffffffffffff19166001600160601b038316179055885188906001600160a01b038516907fa2e524bd0f71903485fbb3d6d50cb305f61005ceea2047c3ac92aa7e0d104306908c9088908110611bf657611bf6615472565b6020026020010151604051611c1a91906001600160601b0391909116815260200190565b60405180910390a350505080611c2f9061549e565b9050611a10565b5060019695505050505050565b6006546000906001600160a01b03163314611c865760065460405163521eb56d60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b038316611cad5760405163d92e233d60e01b815260040160405180910390fd5b506001600160a01b03919091166000908152601260205260409020805460ff1916911515919091179055600190565b600c6020528160005260406000208181548110611cf857600080fd5b90600052602060002001600091509150505481565b60018054610bf490615438565b60006001600a541115611d40576040516345f5ce8b60e11b815260040160405180910390fd5b6002600a55600b54600160601b90046001600160a01b03163314611d9257600b5460405163312d21ff60e11b8152336004820152600160601b9091046001600160a01b03166024820152604401610cf7565b50600b546001600160601b03168015611e7057600b80546bffffffffffffffffffffffff19169055604051600090339083908381818185875af1925050503d8060008114611dfc576040519150601f19603f3d011682016040523d82523d6000602084013e611e01565b606091505b5050905080611e395760405163cd3f165960e01b81526000600482015230602482015233604482015260648101839052608401610cf7565b60405182815233907ff36f4d6622e16a536bbb049064af779cdd483a0b388d347d3752a65f1058bf5b9060200160405180910390a2505b6001600a5590565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6006546001600160a01b03163314611f245760065460405163521eb56d60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b038116611f4b5760405163d92e233d60e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040517f2c1c11af44aa5608f1dca38c00275c30ea091e02417d36e70e9a1538689c433d90600090a250565b6000806001600a541115611fbc576040516345f5ce8b60e11b815260040160405180910390fd5b6002600a556007546001600160a01b031633146120015760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b0384166120285760405163d92e233d60e01b815260040160405180910390fd5b600083815260136020526040902060056002820154600160601b900460ff16600581111561205857612058614bcf565b146120a1576002810154600160601b900460ff16600581111561207d5761207d614bcf565b604051633c053f9d60e21b8152600481019190915260248101859052604401610cf7565b60a084901b6001600160a01b038616176000818152600d6020908152604080832080548251818502810185019093528083529192909190849084015b8282101561212957600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900463ffffffff16818301528252600190920191016120dd565b50508251929350505060008190036121665760405163df2ddd7360e01b81526001600160a01b038916600482015260248101889052604401610cf7565b808460020160088282829054906101000a900463ffffffff16612189919061563c565b92506101000a81548163ffffffff021916908363ffffffff1602179055508360020160089054906101000a900463ffffffff1663ffffffff166000036121df5760028401805460ff60601b1916600160601b1790555b60005b818110156122a7576000889050602084838151811061220357612203615472565b60209081029190910181015181015163ffffffff1690911b919091176000818152600e90925260409091205461224a9064010000000090046001600160601b0316886154d4565b96506011600085848151811061226257612262615472565b602090810291909101810151516001600160a01b0316825281019190915260400160002080546001600160a01b0319169055508061229f8161549e565b9150506121e2565b506000838152600d602052604081206122bf91614859565b6000838152601060205260409020546001600160601b0316808611156122ec57806001600160601b031695505b85156123e55760008481526010602052604080822080546bffffffffffffffffffffffff19169055516001600160a01b038b169088908381818185875af1925050503d806000811461235a576040519150601f19603f3d011682016040523d82523d6000602084013e61235f565b606091505b50509050806123a05760405163cd3f165960e01b8152600060048201523060248201526001600160a01b038b16604482015260648101889052608401610cf7565b896001600160a01b03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d886040516123db91815260200190565b60405180910390a2505b60405188906001600160a01b038b16907f5ebf7fe30be09f0f03b9195632508d95c8b67bf010c93abda67f70d5d9599d1e90600090a350506001600a8190559793965092945050505050565b6000818152600c60209081526040808320805482518185028101850190935280835260609383018282801561248557602002820191906000526020600020905b815481526020019060010190808311612471575b5050505050905080519150915091565b6006546001600160a01b031633146124d55760065460405163521eb56d60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b0381166124fc5760405163d92e233d60e01b815260040160405180910390fd5b600680546001600160a01b0319166001600160a01b0383169081179091556040517f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b90600090a250565b612551858585611159565b6001600160a01b0384163b1561262457604051630a85bd0160e11b808252906001600160a01b0386169063150b7a02906125979033908a90899089908990600401615659565b6020604051808303816000875af11580156125b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125da91906154b7565b6001600160e01b031916146126245760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b6044820152606401610cf7565b5050505050565b6000818152601360205260408120600101546060915060086040518060400160405280600981526020016806630313730313232360bc1b81525061266e836140b8565b61267b608085901b6140b8565b60405160200161268e94939291906156ad565b604051602081830303815290604052915050919050565b6007546000906001600160a01b031633146126e85760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b60006126f3836116c2565b9050876001600160a01b0316816001600160a01b03161461273a5760405163521eb56d60e11b81526001600160a01b03808a16600483015282166024820152604401610cf7565b600083815260136020908152604080832081516101008101835281546001600160601b03811682526001600160a01b03600160601b918290041694820194909452600182015492810192909252600281015463ffffffff8082166060850152640100000000820481166080850152600160401b82041660a08401529192909160c084019160ff91041660058111156127d4576127d4614bcf565b60058111156127e5576127e5614bcf565b81526020016003820180548060200260200160405190810160405280929190818152602001828054801561286457602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116128275790505b50505050508152505090506001600581111561288257612882614bcf565b8160c00151600581111561289857612898614bcf565b146128b3578060c00151600581111561207d5761207d614bcf565b6128be888888614288565b63ffffffff85166060820152600060808201819052875167ffffffffffffffff8111156128ed576128ed614c62565b604051908082528060200260200182016040528015612916578160200160208202803683370190505b5090506000885167ffffffffffffffff81111561293557612935614c62565b60405190808252806020026020018201604052801561297a57816020015b60408051808201909152600080825260208201528152602001906001900390816129535790505b5090506000805b8a51811015612aaf5789818151811061299c5761299c615472565b60200260200101516000015163ffffffff16600003612a1157600088905060208c83815181106129ce576129ce615472565b60209081029190910181015163ffffffff1690911b919091176000908152600e9091526040902080546fffffffffffffffffffffffffffffffff19169055612a9d565b8a8181518110612a2357612a23615472565b6020026020010151848381518110612a3d57612a3d615472565b602002602001019063ffffffff16908163ffffffff1681525050898181518110612a6957612a69615472565b6020026020010151838381518110612a8357612a83615472565b60200260200101819052508180612a999061549e565b9250505b80612aa78161549e565b915050612981565b5060408401518b8114612ae6576000888152600c602090815260408083208054600181018255908452919092200182905585018c90525b612af3858585858c614398565b6000888152601360209081526040918290208751918801516001600160a01b0316600160601b9081026001600160601b03909316929092178155918701516001830155606087015160028301805460808a015160a08b015163ffffffff908116600160401b026bffffffff0000000000000000199282166401000000000267ffffffffffffffff199094169190951617919091179081168317825560c08a01518a9594909360ff60601b19166cffffffffff0000000000000000199092169190911790836005811115612bc857612bc8614bcf565b021790555060e08201518051612be891600384019160209091019061487a565b50506040518d81528991507fff312ce131c4d73ac90ece91266be7090486c5e15f78b7ea2b108c36dfd475299060200160405180910390a25060019c9b505050505050505050505050565b6000806001600a541115612c5a576040516345f5ce8b60e11b815260040160405180910390fd5b6002600a556007546001600160a01b03163314612c9f5760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6000612caa846116c2565b9050846001600160a01b0316816001600160a01b031614612cf15760405163521eb56d60e11b81526001600160a01b03808716600483015282166024820152604401610cf7565b600084815260136020526040902060016002820154600160601b900460ff166005811115612d2157612d21614bcf565b1480612d4c575060056002820154600160601b900460ff166005811115612d4a57612d4a614bcf565b145b15612d95576002810154600160601b900460ff166005811115612d7157612d71614bcf565b604051633c053f9d60e21b8152600481019190915260248101869052604401610cf7565b6002810154600160401b900463ffffffff1615612dcf5760028101805460ff60601b19166c05000000000000000000000000179055612de5565b60028101805460ff60601b1916600160601b1790555b60005b6003820154811015612e725760008690506020836003018381548110612e1057612e10615472565b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff16901b81179050600f60008281526020019081526020016000206000612e619190614929565b50612e6b8161549e565b9050612de8565b5080546040516001600160601b0390911693506000906001600160a01b0388169085908381818185875af1925050503d8060008114612ecd576040519150601f19603f3d011682016040523d82523d6000602084013e612ed2565b606091505b5050905080612f135760405163cd3f165960e01b8152600060048201523060248201526001600160a01b038816604482015260648101859052608401610cf7565b866001600160a01b03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d85604051612f4e91815260200190565b60405180910390a260405186907fe45f5b9540df4f71b7e044809fa318806328c1ea2388a70c7373d97ccf8a0faa90600090a250506001600a819055959194509092505050565b6007546000906001600160a01b03163314612fd85760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b815183511461300757825182516040516308151c1160e41b815260048101929092526024820152604401610cf7565b6000848152601360205260409020600280820154600160601b900460ff16600581111561303657613036614bcf565b1461305b576002810154600160601b900460ff166005811115612d7157612d71614bcf565b83516000805b82811015613150576000889050602087838151811061308257613082615472565b60209081029190910181015163ffffffff90811690921b929092176000818152600e845260408082208151808301909252549384168082526401000000009094046001600160601b0316948101949094529092919003613123578783815181106130ee576130ee615472565b60200260200101518a6040516332832be560e21b8152600401610cf792919063ffffffff929092168252602082015260400190565b602081015161313b906001600160601b0316856154d4565b93505050806131499061549e565b9050613061565b5080341461318157604051637ebbcab960e11b81523460048201526024810182905260448101889052606401610cf7565b6001600160a01b0388811660009081526011602052604090205416156131bd576040516322ddebd960e21b815260048101889052602401610cf7565b60a087901b6001600160a01b0389161760005b838110156134b15760008882815181106131ec576131ec615472565b60200260200101519050600088838151811061320a5761320a615472565b60200260200101519050816001600160a01b03168c6001600160a01b031603613249576040516322ddebd960e21b8152600481018c9052602401610cf7565b6001600160a01b0382811660009081526011602052604090205416156132a0576001600160a01b038281166000908152601160205260409081902054905163631695bd60e01b815291166004820152602401610cf7565b60008b905060208a85815181106132b9576132b9615472565b60209081029190910181015163ffffffff90811690921b929092176000818152600e8452604080822054600f90955290205490929091169003613312576040516304ad100760e21b8152600481018d9052602401610cf7565b6000818152600f602090815260408083208054600181810183559185528385200180546001600160a01b03808a166001600160a01b031990921682179092558a8652600d8552838620845180860190955290845263ffffffff8089168587019081528254948501835591875294909520925192909101805494518416600160a01b0277ffffffffffffffffffffffffffffffffffffffffffffffff19909516929091169190911792909217909155600289018054600160401b90049091169060086133dc8361573f565b91906101000a81548163ffffffff021916908363ffffffff160217905550508c60116000856001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550826001600160a01b03168c8e6001600160a01b03167f6835389a6da5341647f18cbe0a89c56f473f4c17bfaee6e6d07d61f1928e0b7c85604051613495919063ffffffff91909116815260200190565b60405180910390a4505050806134aa9061549e565b90506131d0565b50600284015463ffffffff64010000000082048116600160401b90920416036134f35760028401805460ff60601b19166c030000000000000000000000001790555b6000818152601060205260408120805434929061351a9084906001600160601b03166155f5565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550886001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405161357991815260200190565b60405180910390a250600198975050505050505050565b6007546000906001600160a01b031633146135d35760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b60006135de836116c2565b9050836001600160a01b0316816001600160a01b0316146136255760405163521eb56d60e11b81526001600160a01b03808616600483015282166024820152604401610cf7565b600083815260136020526040902060016002820154600160601b900460ff16600581111561365557613655614bcf565b1461367657604051635960d22f60e11b815260048101859052602401610cf7565b80546001600160601b031634146136bb578054604051631c30abbb60e31b81523460048201526001600160601b03909116602482015260448101859052606401610cf7565b60028101805460ff60601b19166c0200000000000000000000000017905560405184907fa48b531f972c0e4aca57afcc5c099c52a7bd21bc5e2a1b733eec3be9e88da97a90600090a2506001949350505050565b6137576040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529060c08201908152602001606081525090565b60008281526013602090815260409182902082516101008101845281546001600160601b0381168252600160601b908190046001600160a01b031693820193909352600182015493810193909352600281015463ffffffff8082166060860152640100000000820481166080860152600160401b82041660a0850152909160c08401910460ff1660058111156137ef576137ef614bcf565b600581111561380057613800614bcf565b81526020016003820180548060200260200160405190810160405280929190818152602001828054801561387f57602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116138425790505b5050505050815250509050919050565b60006001600a5411156138b5576040516345f5ce8b60e11b815260040160405180910390fd5b6002600a556007546001600160a01b031633146138fa5760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6000613905856116c2565b9050856001600160a01b0316816001600160a01b03161461394c5760405163521eb56d60e11b81526001600160a01b03808816600483015282166024820152604401610cf7565b6001600160a01b03841660009081526012602052604090205460ff1661398f5760405162a2307960e51b81526001600160a01b0385166004820152602401610cf7565b600085815260136020526040902060036002820154600160601b900460ff1660058111156139bf576139bf614bcf565b14613a08576002810154600160601b900460ff1660058111156139e4576139e4614bcf565b604051633c053f9d60e21b8152600481019190915260248101879052604401610cf7565b604080516101008101825282546001600160601b0381168252600160601b908190046001600160a01b03166020830152600184015492820192909252600283015463ffffffff8082166060840152640100000000820481166080840152600160401b82041660a0830152600092613b359291859160c08401910460ff166005811115613a9657613a96614bcf565b6005811115613aa757613aa7614bcf565b815260200160038201805480602002602001604051908101604052809291908181526020018280548015613b2657602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411613ae95790505b50505050508152505088613f67565b6002830154604051631e731b7560e31b81529192506001600160a01b0388169163f398dba891613b7291859163ffffffff16908a90600401615762565b6020604051808303816000875af1158015613b91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bb5919061579d565b82546001600160601b0316600160601b6001600160a01b03831690810291909117845560028401805460ff60601b19166c040000000000000000000000001790556040519195509088907f2d53f895cd5faf3cddba94a25c2ced2105885b5b37450ff430ffa3cbdf332c7490600090a360405187907fa133ed72c03a7d008deaae618a61613c4fd41c67bba1cad1a6bc0a1c5a9c156e90600090a250506001600a5550949350505050565b60006001600a541115613c86576040516345f5ce8b60e11b815260040160405180910390fd5b6002600a556007546001600160a01b03163314613ccb5760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b038616613cf25760405163d92e233d60e01b815260040160405180910390fd5b613cfd858585614288565b60005b8451811015613d9157838181518110613d1b57613d1b615472565b60200260200101516000015163ffffffff1660001480613d615750838181518110613d4857613d48615472565b6020026020010151602001516001600160601b03166000145b15613d7f57604051637c946ed760e01b815260040160405180910390fd5b80613d898161549e565b915050613d00565b505060095480613da08161549e565b915050613deb6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529060c08201908152602001606081525090565b63ffffffff8316606082015260408101869052600160c082018181525050613e17818686885186614398565b6000828152601360209081526040918290208351918401516001600160a01b0316600160601b9081026001600160601b039093169290921781559183015160018301556060830151600283018054608086015160a087015163ffffffff908116600160401b026bffffffff0000000000000000199282166401000000000267ffffffffffffffff199094169190951617919091179081168317825560c0860151869594909360ff60601b19166cffffffffff0000000000000000199092169190911790836005811115613eec57613eec614bcf565b021790555060e08201518051613f0c91600384019160209091019061487a565b5050506009829055613f1e878361464f565b817fb34c1e02384201736eb4693b9b173306cb41bff12f15894dea5773088e9a3b1c87604051613f5091815260200190565b60405180910390a2506001600a5595945050505050565b60608260a0015163ffffffff1667ffffffffffffffff811115613f8c57613f8c614c62565b604051908082528060200260200182016040528015613fb5578160200160208202803683370190505b5090506000805b8460e00151518110156140b057600084905060208660e001518381518110613fe657613fe6615472565b602002602001015163ffffffff16901b8117905060005b6000828152600f602052604090205481101561409b576000828152600f6020526040902080548290811061403357614033615472565b9060005260206000200160009054906101000a90046001600160a01b031685858151811061406357614063615472565b6001600160a01b0390921660209283029190910190910152836140858161549e565b94505080806140939061549e565b915050613ffd565b505080806140a89061549e565b915050613fbc565b505092915050565b7aff00000000000000ff00000000000000ff00000000000000ff00006bffffffff0000000000000000604083901c9081167bffffffff00000000000000000000000000000000000000000000000084161760201c6fffffffff000000000000000000000000919091166001600160e01b031984161717601081901c9182167eff00000000000000ff00000000000000ff00000000000000ff000000000000821617600890811c7bff00000000000000ff00000000000000ff00000000000000ff000000939093167fff00000000000000ff00000000000000ff00000000000000ff000000000000009290921691909117919091179081901c7e0f000f000f000f000f000f000f000f000f000f000f000f000f000f000f000f167f0f000f000f000f000f000f000f000f000f000f000f000f000f000f000f000f00600492831c161790614224827f06060606060606060606060606060606060606060606060606060606060606066154d4565b901c7f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f16602761425491906157ba565b61427e827f30303030303030303030303030303030303030303030303030303030303030306154d4565b610be191906154d4565b60008390036142aa57604051637c946ed760e01b815260040160405180910390fd5b815115806142ba57508051825114155b156142e557815181516040516308151c1160e41b815260048101929092526024820152604401610cf7565b6000805b8351811015612624576142fd8260016154d4565b84828151811061430f5761430f615472565b602002602001015163ffffffff1610156143635783818151811061433557614335615472565b6020026020010151604051632ab10b0b60e21b8152600401610cf7919063ffffffff91909116815260200190565b83818151811061437557614375615472565b602002602001015163ffffffff16915080806143909061549e565b9150506142e9565b60008267ffffffffffffffff8111156143b3576143b3614c62565b6040519080825280602002602001820160405280156143dc578160200160208202803683370190505b5060e087015260005b8381101561456c578581815181106143ff576143ff615472565b60200260200101518760e00151828151811061441d5761441d615472565b63ffffffff909216602092830291909101820152865184919088908490811061444857614448615472565b602002602001015163ffffffff16901b8117905085828151811061446e5761446e615472565b6020908102919091018101516000838152600e8352604090208151815492909301516001600160601b0316640100000000026fffffffffffffffffffffffffffffffff1990921663ffffffff9093169290921717905585518690839081106144d8576144d8615472565b602002602001015160000151886080018181516144f591906157d1565b63ffffffff1690525085516001600160601b0384169087908490811061451d5761451d615472565b6020026020010151602001516001600160601b031611156145595785828151811061454a5761454a615472565b60200260200101516020015192505b50806145648161549e565b9150506143e5565b506001600160601b0381168652608086015160009061458c9060026157ee565b6145979060016157d1565b63ffffffff1690506145aa600382615824565b6000036145c3576145bc600382615838565b90506145dc565b6145ce600382615838565b6145d99060016154d4565b90505b80876060015163ffffffff1610806146075750866080015163ffffffff16876060015163ffffffff16115b15614646576060870151608088015160405163eb3a8ba360e01b815263ffffffff92831660048201526024810184905291166044820152606401610cf7565b50505050505050565b614659828261473f565b6001600160a01b0382163b1561473b57604051630a85bd0160e11b80825233600483015260006024830181905260448301849052608060648401526084830152906001600160a01b0384169063150b7a029060a4016020604051808303816000875af11580156146cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146f191906154b7565b6001600160e01b0319161461473b5760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b6044820152606401610cf7565b5050565b6001600160a01b0382166147895760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b6044820152606401610cf7565b6000818152600260205260409020546001600160a01b0316156147ee5760405162461bcd60e51b815260206004820152600e60248201527f414c52454144595f4d494e5445440000000000000000000000000000000000006044820152606401610cf7565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b50805460008255906000526020600020908101906148779190614947565b50565b828054828255906000526020600020906007016008900481019282156149195791602002820160005b838211156148e757835183826101000a81548163ffffffff021916908363ffffffff16021790555092602001926004016020816003010492830192600103026148a3565b80156149175782816101000a81549063ffffffff02191690556004016020816003010492830192600103026148e7565b505b50614925929150614977565b5090565b50805460008255906000526020600020908101906148779190614977565b5b8082111561492557805477ffffffffffffffffffffffffffffffffffffffffffffffff19168155600101614948565b5b808211156149255760008155600101614978565b6001600160e01b03198116811461487757600080fd5b6000602082840312156149b457600080fd5b81356149bf8161498c565b9392505050565b60005b838110156149e15781810151838201526020016149c9565b50506000910152565b60008151808452614a028160208601602086016149c6565b601f01601f19169290920160200192915050565b6020815260006149bf60208301846149ea565b600060208284031215614a3b57600080fd5b5035919050565b6001600160a01b038116811461487757600080fd5b60008060408385031215614a6a57600080fd5b8235614a7581614a42565b946020939093013593505050565b600060208284031215614a9557600080fd5b81356149bf81614a42565b6000604080830185845260208281860152818651808452606087019150828801935060005b81811015614af9578451805163ffffffff1684528401516001600160601b0316848401529383019391850191600101614ac5565b509098975050505050505050565b60008060408385031215614b1a57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b83811015614b625781516001600160a01b031687529582019590820190600101614b3d565b509495945050505050565b828152604060208201526000614b866040830184614b29565b949350505050565b600080600060608486031215614ba357600080fd5b8335614bae81614a42565b92506020840135614bbe81614a42565b929592945050506040919091013590565b634e487b7160e01b600052602160045260246000fd5b60068110614c0357634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03881681526001600160a01b03871660208201526040810186905263ffffffff85811660608301528481166080830152831660a082015260e08101614c5660c0830184614be5565b98975050505050505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715614c9b57614c9b614c62565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715614cca57614cca614c62565b604052919050565b600067ffffffffffffffff831115614cec57614cec614c62565b614cff601f8401601f1916602001614ca1565b9050828152838383011115614d1357600080fd5b828260208301376000602084830101529392505050565b600060208284031215614d3c57600080fd5b813567ffffffffffffffff811115614d5357600080fd5b8201601f81018413614d6457600080fd5b614b8684823560208401614cd2565b600067ffffffffffffffff821115614d8d57614d8d614c62565b5060051b60200190565b600082601f830112614da857600080fd5b81356020614dbd614db883614d73565b614ca1565b82815260059290921b84018101918181019086841115614ddc57600080fd5b8286015b84811015614e00578035614df381614a42565b8352918301918301614de0565b509695505050505050565b80356001600160601b03811681146115dc57600080fd5b600080600060608486031215614e3757600080fd5b833567ffffffffffffffff80821115614e4f57600080fd5b614e5b87838801614d97565b9450602091508186013581811115614e7257600080fd5b86019050601f81018713614e8557600080fd5b8035614e93614db882614d73565b81815260059190911b82018301908381019089831115614eb257600080fd5b928401925b82841015614ed757614ec884614e0b565b82529284019290840190614eb7565b96999698505050506040949094013593505050565b60008060408385031215614eff57600080fd5b8235614f0a81614a42565b915060208301358015158114614f1f57600080fd5b809150509250929050565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015614f6b57845183529383019391830191600101614f4f565b5090979650505050505050565b600080600080600060808688031215614f9057600080fd5b8535614f9b81614a42565b94506020860135614fab81614a42565b935060408601359250606086013567ffffffffffffffff80821115614fcf57600080fd5b818801915088601f830112614fe357600080fd5b813581811115614ff257600080fd5b89602082850101111561500457600080fd5b9699959850939650602001949392505050565b803563ffffffff811681146115dc57600080fd5b600082601f83011261503c57600080fd5b8135602061504c614db883614d73565b82815260059290921b8401810191818101908684111561506b57600080fd5b8286015b84811015614e005761508081615017565b835291830191830161506f565b600082601f83011261509e57600080fd5b813560206150ae614db883614d73565b82815260069290921b840181019181810190868411156150cd57600080fd5b8286015b84811015614e0057604081890312156150ea5760008081fd5b6150f2614c78565b6150fb82615017565b8152615108858301614e0b565b818601528352918301916040016150d1565b60008060008060008060c0878903121561513357600080fd5b863561513e81614a42565b955060208701359450604087013567ffffffffffffffff8082111561516257600080fd5b61516e8a838b0161502b565b9550606089013591508082111561518457600080fd5b5061519189828a0161508d565b9350506151a060808801615017565b915060a087013590509295509295509295565b600080600080608085870312156151c957600080fd5b84356151d481614a42565b935060208501359250604085013567ffffffffffffffff808211156151f857600080fd5b61520488838901614d97565b9350606087013591508082111561521a57600080fd5b506152278782880161502b565b91505092959194509250565b6000806040838503121561524657600080fd5b823561525181614a42565b91506020830135614f1f81614a42565b600081518084526020808501945080840160005b83811015614b6257815163ffffffff1687529582019590820190600101615275565b602081526001600160601b0382511660208201526001600160a01b03602083015116604082015260408201516060820152600060608301516152e1608084018263ffffffff169052565b50608083015163ffffffff811660a08401525060a083015163ffffffff811660c08401525060c083015161531860e0840182614be5565b5060e083015161010083810152614b86610120840182615261565b6000806000806080858703121561534957600080fd5b843561535481614a42565b935060208501359250604085013561536b81614a42565b9150606085013567ffffffffffffffff81111561538757600080fd5b8501601f8101871361539857600080fd5b61522787823560208401614cd2565b600080600080600060a086880312156153bf57600080fd5b85356153ca81614a42565b945060208601359350604086013567ffffffffffffffff808211156153ee57600080fd5b6153fa89838a0161502b565b9450606088013591508082111561541057600080fd5b5061541d8882890161508d565b92505061542c60808701615017565b90509295509295909350565b600181811c9082168061544c57607f821691505b60208210810361546c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016154b0576154b0615488565b5060010190565b6000602082840312156154c957600080fd5b81516149bf8161498c565b80820180821115610be157610be1615488565b601f82111561142357600081815260208120601f850160051c8101602086101561550e5750805b601f850160051c820191505b8181101561552d5782815560010161551a565b505050505050565b815167ffffffffffffffff81111561554f5761554f614c62565b6155638161555d8454615438565b846154e7565b602080601f83116001811461559857600084156155805750858301515b600019600386901b1c1916600185901b17855561552d565b600085815260208120601f198616915b828110156155c7578886015182559484019460019091019084016155a8565b50858210156155e55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160601b0381811683821601908082111561561557615615615488565b5092915050565b6001600160601b0382811682821603908082111561561557615615615488565b63ffffffff82811682821603908082111561561557615615615488565b60006001600160a01b03808816835280871660208401525084604083015260806060830152826080830152828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b60008086546156bb81615438565b600182811680156156d357600181146156e857615717565b60ff1984168752821515830287019450615717565b8a60005260208060002060005b8581101561570e5781548a8201529084019082016156f5565b50505082870194505b50505050855161572b818360208a016149c6565b019384525050602082015260400192915050565b600063ffffffff80831681810361575857615758615488565b6001019392505050565b6060815260006157756060830186614b29565b63ffffffff85166020840152828103604084015261579381856149ea565b9695505050505050565b6000602082840312156157af57600080fd5b81516149bf81614a42565b8082028115828204841417610be157610be1615488565b63ffffffff81811683821601908082111561561557615615615488565b63ffffffff8181168382160280821691908281146140b0576140b0615488565b634e487b7160e01b600052601260045260246000fd5b6000826158335761583361580e565b500690565b6000826158475761584761580e565b50049056fea2646970667358221220ee3dd136eb9c3aaae80969db0d981f4555af6520415662932908c79dee30e48b64736f6c63430008130033", - "deployedBytecode": "0x6080604052600436106103345760003560e01c806370a08231116101b0578063a60e4c3c116100ec578063dff7672411610095578063ef0e239b1161006f578063ef0e239b14610af7578063f908bc7714610b24578063fbdeb3d714610b44578063ffa1ad7414610b6457600080fd5b8063dff7672414610a96578063e23f6fb414610aa9578063e985e9c514610abc57600080fd5b8063c87b56dd116100c6578063c87b56dd14610a36578063cbf994f814610a56578063ccc9305d14610a7657600080fd5b8063a60e4c3c146109c8578063a6f9dae1146109f6578063b88d4fde14610a1657600080fd5b80638a2bd86f116101595780639890220b116101335780639890220b1461093c578063a22cb46514610951578063a3fbbaae14610971578063a5d059ca1461099157600080fd5b80638a2bd86f146108c25780638da5cb5b1461090757806395d89b411461092757600080fd5b80637c5e63e01161018a5780637c5e63e01461084d57806382694b1d1461088257806386a2bdd4146108a257600080fd5b806370a08231146107c9578063718934d8146107e957806373b8b6a21461082d57600080fd5b806342842e0e1161027f57806355f804b3116102285780636352211e116102025780636352211e1461070a57806363dd76151461072a5780636c0360eb146107945780636f99f15c146107a957600080fd5b806355f804b3146106a357806357838e85146106c35780635e4507fa146106ea57600080fd5b80634eb780da116102595780634eb780da1461062d5780634f558e79146106635780634f6ccce71461068357600080fd5b806342842e0e146105cd578063481c6a75146105ed5780634d486f851461060d57600080fd5b806318160ddd116102e157806323b872dd116102bb57806323b872dd146104d057806342144854146104f05780634236aff81461053e57600080fd5b806318160ddd146104505780631de286ba1461047457806321e4f7bb146104a257600080fd5b8063095ea7b311610312578063095ea7b3146103de57806310c6aa191461040057806317351f7e1461042057600080fd5b806301ffc9a71461033957806306fdde031461036e578063081812fc14610390575b600080fd5b34801561034557600080fd5b506103596103543660046149a2565b610b95565b60405190151581526020015b60405180910390f35b34801561037a57600080fd5b50610383610be7565b6040516103659190614a16565b34801561039c57600080fd5b506103c66103ab366004614a29565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610365565b3480156103ea57600080fd5b506103fe6103f9366004614a57565b610c75565b005b34801561040c57600080fd5b506103fe61041b366004614a83565b610d5c565b34801561042c57600080fd5b5061035961043b366004614a83565b60126020526000908152604090205460ff1681565b34801561045c57600080fd5b5061046660095481565b604051908152602001610365565b34801561048057600080fd5b5061049461048f366004614a29565b610e15565b604051610365929190614aa0565b3480156104ae57600080fd5b506104c26104bd366004614b07565b61106b565b604051610365929190614b6d565b3480156104dc57600080fd5b506103fe6104eb366004614b8e565b611159565b3480156104fc57600080fd5b5061052661050b366004614a29565b6010602052600090815260409020546001600160601b031681565b6040516001600160601b039091168152602001610365565b34801561054a57600080fd5b506105ba610559366004614a29565b6013602052600090815260409020805460018201546002909201546001600160601b03821692600160601b928390046001600160a01b031692909163ffffffff808216926401000000008304821692600160401b8104909216910460ff1687565b6040516103659796959493929190614c07565b3480156105d957600080fd5b506103fe6105e8366004614b8e565b611333565b3480156105f957600080fd5b506007546103c6906001600160a01b031681565b34801561061957600080fd5b506104c2610628366004614a29565b611428565b34801561063957600080fd5b506103c6610648366004614a83565b6011602052600090815260409020546001600160a01b031681565b34801561066f57600080fd5b5061035961067e366004614a29565b61157a565b34801561068f57600080fd5b5061046661069e366004614a29565b61159c565b3480156106af57600080fd5b506103fe6106be366004614d2a565b6115e1565b3480156106cf57600080fd5b50600b546103c690600160601b90046001600160a01b031681565b3480156106f657600080fd5b506103c6610705366004614b07565b61168a565b34801561071657600080fd5b506103c6610725366004614a29565b6116c2565b34801561073657600080fd5b50610770610745366004614a29565b600e6020526000908152604090205463ffffffff81169064010000000090046001600160601b031682565b6040805163ffffffff90931683526001600160601b03909116602083015201610365565b3480156107a057600080fd5b50610383611727565b3480156107b557600080fd5b50600b54610526906001600160601b031681565b3480156107d557600080fd5b506104666107e4366004614a83565b611734565b3480156107f557600080fd5b50610809610804366004614b07565b6117a8565b604080516001600160a01b03909316835263ffffffff909116602083015201610365565b34801561083957600080fd5b50610359610848366004614e22565b6117ee565b34801561085957600080fd5b506103836040518060400160405280600981526020016806630313730313232360bc1b81525081565b34801561088e57600080fd5b5061035961089d366004614eec565b611c43565b3480156108ae57600080fd5b506104666108bd366004614b07565b611cdc565b3480156108ce57600080fd5b506104666108dd366004614a57565b60a01b6001600160a01b03909116176000908152601060205260409020546001600160601b031690565b34801561091357600080fd5b506006546103c6906001600160a01b031681565b34801561093357600080fd5b50610383611d0d565b34801561094857600080fd5b50610466611d1a565b34801561095d57600080fd5b506103fe61096c366004614eec565b611e78565b34801561097d57600080fd5b506103fe61098c366004614a83565b611ee4565b34801561099d57600080fd5b506109b16109ac366004614a57565b611f95565b604080519215158352602083019190915201610365565b3480156109d457600080fd5b506109e86109e3366004614a29565b612431565b604051610365929190614f2a565b348015610a0257600080fd5b506103fe610a11366004614a83565b612495565b348015610a2257600080fd5b506103fe610a31366004614f78565b612546565b348015610a4257600080fd5b50610383610a51366004614a29565b61262b565b348015610a6257600080fd5b50610359610a7136600461511a565b6126a5565b348015610a8257600080fd5b506109b1610a91366004614a57565b612c33565b610359610aa43660046151b3565b612f95565b610359610ab7366004614a57565b613590565b348015610ac857600080fd5b50610359610ad7366004615233565b600560209081526000928352604080842090915290825290205460ff1681565b348015610b0357600080fd5b50610b17610b12366004614a29565b61370f565b6040516103659190615297565b348015610b3057600080fd5b506103c6610b3f366004615333565b61388f565b348015610b5057600080fd5b50610466610b5f3660046153a7565b613c60565b348015610b7057600080fd5b50610383604051806040016040528060058152602001640312e302e360dc1b81525081565b60006301ffc9a760e01b6001600160e01b031983161480610bc657506380ac58cd60e01b6001600160e01b03198316145b80610be15750635b5e139f60e01b6001600160e01b03198316145b92915050565b60008054610bf490615438565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2090615438565b8015610c6d5780601f10610c4257610100808354040283529160200191610c6d565b820191906000526020600020905b815481529060010190602001808311610c5057829003601f168201915b505050505081565b6000818152600260205260409020546001600160a01b031633811480610cbe57506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b610d005760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6006546001600160a01b03163314610d9c5760065460405163521eb56d60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b038116610dc35760405163d92e233d60e01b815260040160405180910390fd5b600b80546001600160601b0316600160601b6001600160a01b038416908102919091179091556040517f8d1e8547016120917daad7f81c42b48f7fee379badc48f1889f0f43bb619472590600090a250565b600081815260136020908152604080832081516101008101835281546001600160601b03811682526001600160a01b03600160601b918290041694820194909452600182015492810192909252600281015463ffffffff808216606085810191909152640100000000830482166080860152600160401b830490911660a0850152938593929160c084019160ff9104166005811115610eb657610eb6614bcf565b6005811115610ec757610ec7614bcf565b815260200160038201805480602002602001604051908101604052809291908181526020018280548015610f4657602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411610f095790505b50505050508152505090508060e001515192508267ffffffffffffffff811115610f7257610f72614c62565b604051908082528060200260200182016040528015610fb757816020015b6040805180820190915260008082526020820152815260200190600190039081610f905790505b50915060005b8381101561106457600085905060208360e001518381518110610fe257610fe2615472565b60209081029190910181015163ffffffff90811690921b929092176000818152600e845260409081902081518083019092525492831681526401000000009092046001600160601b031692820192909252845185908490811061104757611047615472565b6020026020010181905250508061105d9061549e565b9050610fbd565b5050915091565b602081811b83176000818152600f909252604090912054906060908267ffffffffffffffff81111561109f5761109f614c62565b6040519080825280602002602001820160405280156110c8578160200160208202803683370190505b50915060005b83811015611150576000828152600f602052604090208054829081106110f6576110f6615472565b9060005260206000200160009054906101000a90046001600160a01b031683828151811061112657611126615472565b6001600160a01b0390921660209283029190910190910152806111488161549e565b9150506110ce565b50509250929050565b6000818152600260205260409020546001600160a01b038481169116146111c25760405162461bcd60e51b815260206004820152600a60248201527f57524f4e475f46524f4d000000000000000000000000000000000000000000006044820152606401610cf7565b6001600160a01b03821661120c5760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b6044820152606401610cf7565b336001600160a01b038416148061124657506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b8061126757506000818152600460205260409020546001600160a01b031633145b6112a45760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b6044820152606401610cf7565b6001600160a01b0380841660008181526003602090815260408083208054600019019055938616808352848320805460010190558583526002825284832080546001600160a01b03199081168317909155600490925284832080549092169091559251849392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61133e838383611159565b6001600160a01b0382163b1561142357604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af11580156113b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d991906154b7565b6001600160e01b031916146114235760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b6044820152606401610cf7565b505050565b600081815260136020908152604080832081516101008101835281546001600160601b03811682526001600160a01b03600160601b918290041694820194909452600182015492810192909252600281015463ffffffff808216606085810191909152640100000000830482166080860152600160401b830490911660a0850152938593929160c084019160ff91041660058111156114c9576114c9614bcf565b60058111156114da576114da614bcf565b81526020016003820180548060200260200160405190810160405280929190818152602001828054801561155957602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff168152602001906004019060208260030104928301926001038202915080841161151c5790505b505050505081525050905061156e8185613f67565b91508151925050915091565b60008082118015610be157506009546115949060016154d4565b821092915050565b60006115a98260016154d4565b90506009548111156115dc57600954604051637ae5968560e01b8152610cf7918391600401918252602082015260400190565b919050565b6006546001600160a01b031633146116215760065460405163521eb56d60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b805160000361164357604051637c946ed760e01b815260040160405180910390fd5b600861164f8282615535565b507f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf68160405161167f9190614a16565b60405180910390a150565b600f60205281600052604060002081815481106116a657600080fd5b6000918252602090912001546001600160a01b03169150829050565b6000818152600260205260409020546001600160a01b0316806115dc5760405162461bcd60e51b815260206004820152600a60248201527f4e4f545f4d494e544544000000000000000000000000000000000000000000006044820152606401610cf7565b60088054610bf490615438565b60006001600160a01b03821661178c5760405162461bcd60e51b815260206004820152600c60248201527f5a45524f5f4144445245535300000000000000000000000000000000000000006044820152606401610cf7565b506001600160a01b031660009081526003602052604090205490565b600d60205281600052604060002081815481106117c457600080fd5b6000918252602090912001546001600160a01b0381169250600160a01b900463ffffffff16905082565b600081815260136020908152604080832081516101008101835281546001600160601b0381168252600160601b908190046001600160a01b031694820194909452600182015492810192909252600281015463ffffffff8082166060850152640100000000820481166080850152600160401b82041660a0840152849360c08401910460ff16600581111561188557611885614bcf565b600581111561189657611896614bcf565b81526020016003820180548060200260200160405190810160405280929190818152602001828054801561191557602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116118d85790505b50505050508152505090506004600581111561193357611933614bcf565b8160c00151600581111561194957611949614bcf565b14611988578060c00151600581111561196457611964614bcf565b604051633c053f9d60e21b8152600481019190915260248101849052604401610cf7565b83518551146119b757845184516040516308151c1160e41b815260048101929092526024820152604401610cf7565b80602001516001600160a01b0316336001600160a01b031614611a0b5760208101516040516379f91cd360e01b81523360048201526001600160a01b03909116602482015260448101849052606401610cf7565b845160005b81811015611c3657600060116000898481518110611a3057611a30615472565b6020908102919091018101516001600160a01b03908116835282820193909352604091820160009081205490931660a08a901b81178085526010909252919092205489519193506001600160601b03169081908a9086908110611a9557611a95615472565b60200260200101516001611aa991906155f5565b6001600160601b03161115611b0357600b8054829190600090611ad69084906001600160601b03166155f5565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555060009050611b87565b888481518110611b1557611b15615472565b6020908102919091010151600b8054600090611b3b9084906001600160601b03166155f5565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550888481518110611b7157611b71615472565b602002602001015181611b84919061561c565b90505b600082815260106020526040902080546bffffffffffffffffffffffff19166001600160601b038316179055885188906001600160a01b038516907fa2e524bd0f71903485fbb3d6d50cb305f61005ceea2047c3ac92aa7e0d104306908c9088908110611bf657611bf6615472565b6020026020010151604051611c1a91906001600160601b0391909116815260200190565b60405180910390a350505080611c2f9061549e565b9050611a10565b5060019695505050505050565b6006546000906001600160a01b03163314611c865760065460405163521eb56d60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b038316611cad5760405163d92e233d60e01b815260040160405180910390fd5b506001600160a01b03919091166000908152601260205260409020805460ff1916911515919091179055600190565b600c6020528160005260406000208181548110611cf857600080fd5b90600052602060002001600091509150505481565b60018054610bf490615438565b60006001600a541115611d40576040516345f5ce8b60e11b815260040160405180910390fd5b6002600a55600b54600160601b90046001600160a01b03163314611d9257600b5460405163312d21ff60e11b8152336004820152600160601b9091046001600160a01b03166024820152604401610cf7565b50600b546001600160601b03168015611e7057600b80546bffffffffffffffffffffffff19169055604051600090339083908381818185875af1925050503d8060008114611dfc576040519150601f19603f3d011682016040523d82523d6000602084013e611e01565b606091505b5050905080611e395760405163cd3f165960e01b81526000600482015230602482015233604482015260648101839052608401610cf7565b60405182815233907ff36f4d6622e16a536bbb049064af779cdd483a0b388d347d3752a65f1058bf5b9060200160405180910390a2505b6001600a5590565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6006546001600160a01b03163314611f245760065460405163521eb56d60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b038116611f4b5760405163d92e233d60e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040517f2c1c11af44aa5608f1dca38c00275c30ea091e02417d36e70e9a1538689c433d90600090a250565b6000806001600a541115611fbc576040516345f5ce8b60e11b815260040160405180910390fd5b6002600a556007546001600160a01b031633146120015760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b0384166120285760405163d92e233d60e01b815260040160405180910390fd5b600083815260136020526040902060056002820154600160601b900460ff16600581111561205857612058614bcf565b146120a1576002810154600160601b900460ff16600581111561207d5761207d614bcf565b604051633c053f9d60e21b8152600481019190915260248101859052604401610cf7565b60a084901b6001600160a01b038616176000818152600d6020908152604080832080548251818502810185019093528083529192909190849084015b8282101561212957600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900463ffffffff16818301528252600190920191016120dd565b50508251929350505060008190036121665760405163df2ddd7360e01b81526001600160a01b038916600482015260248101889052604401610cf7565b808460020160088282829054906101000a900463ffffffff16612189919061563c565b92506101000a81548163ffffffff021916908363ffffffff1602179055508360020160089054906101000a900463ffffffff1663ffffffff166000036121df5760028401805460ff60601b1916600160601b1790555b60005b818110156122a7576000889050602084838151811061220357612203615472565b60209081029190910181015181015163ffffffff1690911b919091176000818152600e90925260409091205461224a9064010000000090046001600160601b0316886154d4565b96506011600085848151811061226257612262615472565b602090810291909101810151516001600160a01b0316825281019190915260400160002080546001600160a01b0319169055508061229f8161549e565b9150506121e2565b506000838152600d602052604081206122bf91614859565b6000838152601060205260409020546001600160601b0316808611156122ec57806001600160601b031695505b85156123e55760008481526010602052604080822080546bffffffffffffffffffffffff19169055516001600160a01b038b169088908381818185875af1925050503d806000811461235a576040519150601f19603f3d011682016040523d82523d6000602084013e61235f565b606091505b50509050806123a05760405163cd3f165960e01b8152600060048201523060248201526001600160a01b038b16604482015260648101889052608401610cf7565b896001600160a01b03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d886040516123db91815260200190565b60405180910390a2505b60405188906001600160a01b038b16907f5ebf7fe30be09f0f03b9195632508d95c8b67bf010c93abda67f70d5d9599d1e90600090a350506001600a8190559793965092945050505050565b6000818152600c60209081526040808320805482518185028101850190935280835260609383018282801561248557602002820191906000526020600020905b815481526020019060010190808311612471575b5050505050905080519150915091565b6006546001600160a01b031633146124d55760065460405163521eb56d60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b0381166124fc5760405163d92e233d60e01b815260040160405180910390fd5b600680546001600160a01b0319166001600160a01b0383169081179091556040517f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b90600090a250565b612551858585611159565b6001600160a01b0384163b1561262457604051630a85bd0160e11b808252906001600160a01b0386169063150b7a02906125979033908a90899089908990600401615659565b6020604051808303816000875af11580156125b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125da91906154b7565b6001600160e01b031916146126245760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b6044820152606401610cf7565b5050505050565b6000818152601360205260408120600101546060915060086040518060400160405280600981526020016806630313730313232360bc1b81525061266e836140b8565b61267b608085901b6140b8565b60405160200161268e94939291906156ad565b604051602081830303815290604052915050919050565b6007546000906001600160a01b031633146126e85760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b60006126f3836116c2565b9050876001600160a01b0316816001600160a01b03161461273a5760405163521eb56d60e11b81526001600160a01b03808a16600483015282166024820152604401610cf7565b600083815260136020908152604080832081516101008101835281546001600160601b03811682526001600160a01b03600160601b918290041694820194909452600182015492810192909252600281015463ffffffff8082166060850152640100000000820481166080850152600160401b82041660a08401529192909160c084019160ff91041660058111156127d4576127d4614bcf565b60058111156127e5576127e5614bcf565b81526020016003820180548060200260200160405190810160405280929190818152602001828054801561286457602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116128275790505b50505050508152505090506001600581111561288257612882614bcf565b8160c00151600581111561289857612898614bcf565b146128b3578060c00151600581111561207d5761207d614bcf565b6128be888888614288565b63ffffffff85166060820152600060808201819052875167ffffffffffffffff8111156128ed576128ed614c62565b604051908082528060200260200182016040528015612916578160200160208202803683370190505b5090506000885167ffffffffffffffff81111561293557612935614c62565b60405190808252806020026020018201604052801561297a57816020015b60408051808201909152600080825260208201528152602001906001900390816129535790505b5090506000805b8a51811015612aaf5789818151811061299c5761299c615472565b60200260200101516000015163ffffffff16600003612a1157600088905060208c83815181106129ce576129ce615472565b60209081029190910181015163ffffffff1690911b919091176000908152600e9091526040902080546fffffffffffffffffffffffffffffffff19169055612a9d565b8a8181518110612a2357612a23615472565b6020026020010151848381518110612a3d57612a3d615472565b602002602001019063ffffffff16908163ffffffff1681525050898181518110612a6957612a69615472565b6020026020010151838381518110612a8357612a83615472565b60200260200101819052508180612a999061549e565b9250505b80612aa78161549e565b915050612981565b5060408401518b8114612ae6576000888152600c602090815260408083208054600181018255908452919092200182905585018c90525b612af3858585858c614398565b6000888152601360209081526040918290208751918801516001600160a01b0316600160601b9081026001600160601b03909316929092178155918701516001830155606087015160028301805460808a015160a08b015163ffffffff908116600160401b026bffffffff0000000000000000199282166401000000000267ffffffffffffffff199094169190951617919091179081168317825560c08a01518a9594909360ff60601b19166cffffffffff0000000000000000199092169190911790836005811115612bc857612bc8614bcf565b021790555060e08201518051612be891600384019160209091019061487a565b50506040518d81528991507fff312ce131c4d73ac90ece91266be7090486c5e15f78b7ea2b108c36dfd475299060200160405180910390a25060019c9b505050505050505050505050565b6000806001600a541115612c5a576040516345f5ce8b60e11b815260040160405180910390fd5b6002600a556007546001600160a01b03163314612c9f5760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6000612caa846116c2565b9050846001600160a01b0316816001600160a01b031614612cf15760405163521eb56d60e11b81526001600160a01b03808716600483015282166024820152604401610cf7565b600084815260136020526040902060016002820154600160601b900460ff166005811115612d2157612d21614bcf565b1480612d4c575060056002820154600160601b900460ff166005811115612d4a57612d4a614bcf565b145b15612d95576002810154600160601b900460ff166005811115612d7157612d71614bcf565b604051633c053f9d60e21b8152600481019190915260248101869052604401610cf7565b6002810154600160401b900463ffffffff1615612dcf5760028101805460ff60601b19166c05000000000000000000000000179055612de5565b60028101805460ff60601b1916600160601b1790555b60005b6003820154811015612e725760008690506020836003018381548110612e1057612e10615472565b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff16901b81179050600f60008281526020019081526020016000206000612e619190614929565b50612e6b8161549e565b9050612de8565b5080546040516001600160601b0390911693506000906001600160a01b0388169085908381818185875af1925050503d8060008114612ecd576040519150601f19603f3d011682016040523d82523d6000602084013e612ed2565b606091505b5050905080612f135760405163cd3f165960e01b8152600060048201523060248201526001600160a01b038816604482015260648101859052608401610cf7565b866001600160a01b03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d85604051612f4e91815260200190565b60405180910390a260405186907fe45f5b9540df4f71b7e044809fa318806328c1ea2388a70c7373d97ccf8a0faa90600090a250506001600a819055959194509092505050565b6007546000906001600160a01b03163314612fd85760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b815183511461300757825182516040516308151c1160e41b815260048101929092526024820152604401610cf7565b6000848152601360205260409020600280820154600160601b900460ff16600581111561303657613036614bcf565b1461305b576002810154600160601b900460ff166005811115612d7157612d71614bcf565b83516000805b82811015613150576000889050602087838151811061308257613082615472565b60209081029190910181015163ffffffff90811690921b929092176000818152600e845260408082208151808301909252549384168082526401000000009094046001600160601b0316948101949094529092919003613123578783815181106130ee576130ee615472565b60200260200101518a6040516332832be560e21b8152600401610cf792919063ffffffff929092168252602082015260400190565b602081015161313b906001600160601b0316856154d4565b93505050806131499061549e565b9050613061565b5080341461318157604051637ebbcab960e11b81523460048201526024810182905260448101889052606401610cf7565b6001600160a01b0388811660009081526011602052604090205416156131bd576040516322ddebd960e21b815260048101889052602401610cf7565b60a087901b6001600160a01b0389161760005b838110156134b15760008882815181106131ec576131ec615472565b60200260200101519050600088838151811061320a5761320a615472565b60200260200101519050816001600160a01b03168c6001600160a01b031603613249576040516322ddebd960e21b8152600481018c9052602401610cf7565b6001600160a01b0382811660009081526011602052604090205416156132a0576001600160a01b038281166000908152601160205260409081902054905163631695bd60e01b815291166004820152602401610cf7565b60008b905060208a85815181106132b9576132b9615472565b60209081029190910181015163ffffffff90811690921b929092176000818152600e8452604080822054600f90955290205490929091169003613312576040516304ad100760e21b8152600481018d9052602401610cf7565b6000818152600f602090815260408083208054600181810183559185528385200180546001600160a01b03808a166001600160a01b031990921682179092558a8652600d8552838620845180860190955290845263ffffffff8089168587019081528254948501835591875294909520925192909101805494518416600160a01b0277ffffffffffffffffffffffffffffffffffffffffffffffff19909516929091169190911792909217909155600289018054600160401b90049091169060086133dc8361573f565b91906101000a81548163ffffffff021916908363ffffffff160217905550508c60116000856001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550826001600160a01b03168c8e6001600160a01b03167f6835389a6da5341647f18cbe0a89c56f473f4c17bfaee6e6d07d61f1928e0b7c85604051613495919063ffffffff91909116815260200190565b60405180910390a4505050806134aa9061549e565b90506131d0565b50600284015463ffffffff64010000000082048116600160401b90920416036134f35760028401805460ff60601b19166c030000000000000000000000001790555b6000818152601060205260408120805434929061351a9084906001600160601b03166155f5565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550886001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405161357991815260200190565b60405180910390a250600198975050505050505050565b6007546000906001600160a01b031633146135d35760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b60006135de836116c2565b9050836001600160a01b0316816001600160a01b0316146136255760405163521eb56d60e11b81526001600160a01b03808616600483015282166024820152604401610cf7565b600083815260136020526040902060016002820154600160601b900460ff16600581111561365557613655614bcf565b1461367657604051635960d22f60e11b815260048101859052602401610cf7565b80546001600160601b031634146136bb578054604051631c30abbb60e31b81523460048201526001600160601b03909116602482015260448101859052606401610cf7565b60028101805460ff60601b19166c0200000000000000000000000017905560405184907fa48b531f972c0e4aca57afcc5c099c52a7bd21bc5e2a1b733eec3be9e88da97a90600090a2506001949350505050565b6137576040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529060c08201908152602001606081525090565b60008281526013602090815260409182902082516101008101845281546001600160601b0381168252600160601b908190046001600160a01b031693820193909352600182015493810193909352600281015463ffffffff8082166060860152640100000000820481166080860152600160401b82041660a0850152909160c08401910460ff1660058111156137ef576137ef614bcf565b600581111561380057613800614bcf565b81526020016003820180548060200260200160405190810160405280929190818152602001828054801561387f57602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116138425790505b5050505050815250509050919050565b60006001600a5411156138b5576040516345f5ce8b60e11b815260040160405180910390fd5b6002600a556007546001600160a01b031633146138fa5760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6000613905856116c2565b9050856001600160a01b0316816001600160a01b03161461394c5760405163521eb56d60e11b81526001600160a01b03808816600483015282166024820152604401610cf7565b6001600160a01b03841660009081526012602052604090205460ff1661398f5760405162a2307960e51b81526001600160a01b0385166004820152602401610cf7565b600085815260136020526040902060036002820154600160601b900460ff1660058111156139bf576139bf614bcf565b14613a08576002810154600160601b900460ff1660058111156139e4576139e4614bcf565b604051633c053f9d60e21b8152600481019190915260248101879052604401610cf7565b604080516101008101825282546001600160601b0381168252600160601b908190046001600160a01b03166020830152600184015492820192909252600283015463ffffffff8082166060840152640100000000820481166080840152600160401b82041660a0830152600092613b359291859160c08401910460ff166005811115613a9657613a96614bcf565b6005811115613aa757613aa7614bcf565b815260200160038201805480602002602001604051908101604052809291908181526020018280548015613b2657602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411613ae95790505b50505050508152505088613f67565b6002830154604051631e731b7560e31b81529192506001600160a01b0388169163f398dba891613b7291859163ffffffff16908a90600401615762565b6020604051808303816000875af1158015613b91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bb5919061579d565b82546001600160601b0316600160601b6001600160a01b03831690810291909117845560028401805460ff60601b19166c040000000000000000000000001790556040519195509088907f2d53f895cd5faf3cddba94a25c2ced2105885b5b37450ff430ffa3cbdf332c7490600090a360405187907fa133ed72c03a7d008deaae618a61613c4fd41c67bba1cad1a6bc0a1c5a9c156e90600090a250506001600a5550949350505050565b60006001600a541115613c86576040516345f5ce8b60e11b815260040160405180910390fd5b6002600a556007546001600160a01b03163314613ccb5760075460405163312d21ff60e11b81523360048201526001600160a01b039091166024820152604401610cf7565b6001600160a01b038616613cf25760405163d92e233d60e01b815260040160405180910390fd5b613cfd858585614288565b60005b8451811015613d9157838181518110613d1b57613d1b615472565b60200260200101516000015163ffffffff1660001480613d615750838181518110613d4857613d48615472565b6020026020010151602001516001600160601b03166000145b15613d7f57604051637c946ed760e01b815260040160405180910390fd5b80613d898161549e565b915050613d00565b505060095480613da08161549e565b915050613deb6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529060c08201908152602001606081525090565b63ffffffff8316606082015260408101869052600160c082018181525050613e17818686885186614398565b6000828152601360209081526040918290208351918401516001600160a01b0316600160601b9081026001600160601b039093169290921781559183015160018301556060830151600283018054608086015160a087015163ffffffff908116600160401b026bffffffff0000000000000000199282166401000000000267ffffffffffffffff199094169190951617919091179081168317825560c0860151869594909360ff60601b19166cffffffffff0000000000000000199092169190911790836005811115613eec57613eec614bcf565b021790555060e08201518051613f0c91600384019160209091019061487a565b5050506009829055613f1e878361464f565b817fb34c1e02384201736eb4693b9b173306cb41bff12f15894dea5773088e9a3b1c87604051613f5091815260200190565b60405180910390a2506001600a5595945050505050565b60608260a0015163ffffffff1667ffffffffffffffff811115613f8c57613f8c614c62565b604051908082528060200260200182016040528015613fb5578160200160208202803683370190505b5090506000805b8460e00151518110156140b057600084905060208660e001518381518110613fe657613fe6615472565b602002602001015163ffffffff16901b8117905060005b6000828152600f602052604090205481101561409b576000828152600f6020526040902080548290811061403357614033615472565b9060005260206000200160009054906101000a90046001600160a01b031685858151811061406357614063615472565b6001600160a01b0390921660209283029190910190910152836140858161549e565b94505080806140939061549e565b915050613ffd565b505080806140a89061549e565b915050613fbc565b505092915050565b7aff00000000000000ff00000000000000ff00000000000000ff00006bffffffff0000000000000000604083901c9081167bffffffff00000000000000000000000000000000000000000000000084161760201c6fffffffff000000000000000000000000919091166001600160e01b031984161717601081901c9182167eff00000000000000ff00000000000000ff00000000000000ff000000000000821617600890811c7bff00000000000000ff00000000000000ff00000000000000ff000000939093167fff00000000000000ff00000000000000ff00000000000000ff000000000000009290921691909117919091179081901c7e0f000f000f000f000f000f000f000f000f000f000f000f000f000f000f000f167f0f000f000f000f000f000f000f000f000f000f000f000f000f000f000f000f00600492831c161790614224827f06060606060606060606060606060606060606060606060606060606060606066154d4565b901c7f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f16602761425491906157ba565b61427e827f30303030303030303030303030303030303030303030303030303030303030306154d4565b610be191906154d4565b60008390036142aa57604051637c946ed760e01b815260040160405180910390fd5b815115806142ba57508051825114155b156142e557815181516040516308151c1160e41b815260048101929092526024820152604401610cf7565b6000805b8351811015612624576142fd8260016154d4565b84828151811061430f5761430f615472565b602002602001015163ffffffff1610156143635783818151811061433557614335615472565b6020026020010151604051632ab10b0b60e21b8152600401610cf7919063ffffffff91909116815260200190565b83818151811061437557614375615472565b602002602001015163ffffffff16915080806143909061549e565b9150506142e9565b60008267ffffffffffffffff8111156143b3576143b3614c62565b6040519080825280602002602001820160405280156143dc578160200160208202803683370190505b5060e087015260005b8381101561456c578581815181106143ff576143ff615472565b60200260200101518760e00151828151811061441d5761441d615472565b63ffffffff909216602092830291909101820152865184919088908490811061444857614448615472565b602002602001015163ffffffff16901b8117905085828151811061446e5761446e615472565b6020908102919091018101516000838152600e8352604090208151815492909301516001600160601b0316640100000000026fffffffffffffffffffffffffffffffff1990921663ffffffff9093169290921717905585518690839081106144d8576144d8615472565b602002602001015160000151886080018181516144f591906157d1565b63ffffffff1690525085516001600160601b0384169087908490811061451d5761451d615472565b6020026020010151602001516001600160601b031611156145595785828151811061454a5761454a615472565b60200260200101516020015192505b50806145648161549e565b9150506143e5565b506001600160601b0381168652608086015160009061458c9060026157ee565b6145979060016157d1565b63ffffffff1690506145aa600382615824565b6000036145c3576145bc600382615838565b90506145dc565b6145ce600382615838565b6145d99060016154d4565b90505b80876060015163ffffffff1610806146075750866080015163ffffffff16876060015163ffffffff16115b15614646576060870151608088015160405163eb3a8ba360e01b815263ffffffff92831660048201526024810184905291166044820152606401610cf7565b50505050505050565b614659828261473f565b6001600160a01b0382163b1561473b57604051630a85bd0160e11b80825233600483015260006024830181905260448301849052608060648401526084830152906001600160a01b0384169063150b7a029060a4016020604051808303816000875af11580156146cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146f191906154b7565b6001600160e01b0319161461473b5760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b6044820152606401610cf7565b5050565b6001600160a01b0382166147895760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b6044820152606401610cf7565b6000818152600260205260409020546001600160a01b0316156147ee5760405162461bcd60e51b815260206004820152600e60248201527f414c52454144595f4d494e5445440000000000000000000000000000000000006044820152606401610cf7565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b50805460008255906000526020600020908101906148779190614947565b50565b828054828255906000526020600020906007016008900481019282156149195791602002820160005b838211156148e757835183826101000a81548163ffffffff021916908363ffffffff16021790555092602001926004016020816003010492830192600103026148a3565b80156149175782816101000a81549063ffffffff02191690556004016020816003010492830192600103026148e7565b505b50614925929150614977565b5090565b50805460008255906000526020600020908101906148779190614977565b5b8082111561492557805477ffffffffffffffffffffffffffffffffffffffffffffffff19168155600101614948565b5b808211156149255760008155600101614978565b6001600160e01b03198116811461487757600080fd5b6000602082840312156149b457600080fd5b81356149bf8161498c565b9392505050565b60005b838110156149e15781810151838201526020016149c9565b50506000910152565b60008151808452614a028160208601602086016149c6565b601f01601f19169290920160200192915050565b6020815260006149bf60208301846149ea565b600060208284031215614a3b57600080fd5b5035919050565b6001600160a01b038116811461487757600080fd5b60008060408385031215614a6a57600080fd5b8235614a7581614a42565b946020939093013593505050565b600060208284031215614a9557600080fd5b81356149bf81614a42565b6000604080830185845260208281860152818651808452606087019150828801935060005b81811015614af9578451805163ffffffff1684528401516001600160601b0316848401529383019391850191600101614ac5565b509098975050505050505050565b60008060408385031215614b1a57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b83811015614b625781516001600160a01b031687529582019590820190600101614b3d565b509495945050505050565b828152604060208201526000614b866040830184614b29565b949350505050565b600080600060608486031215614ba357600080fd5b8335614bae81614a42565b92506020840135614bbe81614a42565b929592945050506040919091013590565b634e487b7160e01b600052602160045260246000fd5b60068110614c0357634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03881681526001600160a01b03871660208201526040810186905263ffffffff85811660608301528481166080830152831660a082015260e08101614c5660c0830184614be5565b98975050505050505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715614c9b57614c9b614c62565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715614cca57614cca614c62565b604052919050565b600067ffffffffffffffff831115614cec57614cec614c62565b614cff601f8401601f1916602001614ca1565b9050828152838383011115614d1357600080fd5b828260208301376000602084830101529392505050565b600060208284031215614d3c57600080fd5b813567ffffffffffffffff811115614d5357600080fd5b8201601f81018413614d6457600080fd5b614b8684823560208401614cd2565b600067ffffffffffffffff821115614d8d57614d8d614c62565b5060051b60200190565b600082601f830112614da857600080fd5b81356020614dbd614db883614d73565b614ca1565b82815260059290921b84018101918181019086841115614ddc57600080fd5b8286015b84811015614e00578035614df381614a42565b8352918301918301614de0565b509695505050505050565b80356001600160601b03811681146115dc57600080fd5b600080600060608486031215614e3757600080fd5b833567ffffffffffffffff80821115614e4f57600080fd5b614e5b87838801614d97565b9450602091508186013581811115614e7257600080fd5b86019050601f81018713614e8557600080fd5b8035614e93614db882614d73565b81815260059190911b82018301908381019089831115614eb257600080fd5b928401925b82841015614ed757614ec884614e0b565b82529284019290840190614eb7565b96999698505050506040949094013593505050565b60008060408385031215614eff57600080fd5b8235614f0a81614a42565b915060208301358015158114614f1f57600080fd5b809150509250929050565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015614f6b57845183529383019391830191600101614f4f565b5090979650505050505050565b600080600080600060808688031215614f9057600080fd5b8535614f9b81614a42565b94506020860135614fab81614a42565b935060408601359250606086013567ffffffffffffffff80821115614fcf57600080fd5b818801915088601f830112614fe357600080fd5b813581811115614ff257600080fd5b89602082850101111561500457600080fd5b9699959850939650602001949392505050565b803563ffffffff811681146115dc57600080fd5b600082601f83011261503c57600080fd5b8135602061504c614db883614d73565b82815260059290921b8401810191818101908684111561506b57600080fd5b8286015b84811015614e005761508081615017565b835291830191830161506f565b600082601f83011261509e57600080fd5b813560206150ae614db883614d73565b82815260069290921b840181019181810190868411156150cd57600080fd5b8286015b84811015614e0057604081890312156150ea5760008081fd5b6150f2614c78565b6150fb82615017565b8152615108858301614e0b565b818601528352918301916040016150d1565b60008060008060008060c0878903121561513357600080fd5b863561513e81614a42565b955060208701359450604087013567ffffffffffffffff8082111561516257600080fd5b61516e8a838b0161502b565b9550606089013591508082111561518457600080fd5b5061519189828a0161508d565b9350506151a060808801615017565b915060a087013590509295509295509295565b600080600080608085870312156151c957600080fd5b84356151d481614a42565b935060208501359250604085013567ffffffffffffffff808211156151f857600080fd5b61520488838901614d97565b9350606087013591508082111561521a57600080fd5b506152278782880161502b565b91505092959194509250565b6000806040838503121561524657600080fd5b823561525181614a42565b91506020830135614f1f81614a42565b600081518084526020808501945080840160005b83811015614b6257815163ffffffff1687529582019590820190600101615275565b602081526001600160601b0382511660208201526001600160a01b03602083015116604082015260408201516060820152600060608301516152e1608084018263ffffffff169052565b50608083015163ffffffff811660a08401525060a083015163ffffffff811660c08401525060c083015161531860e0840182614be5565b5060e083015161010083810152614b86610120840182615261565b6000806000806080858703121561534957600080fd5b843561535481614a42565b935060208501359250604085013561536b81614a42565b9150606085013567ffffffffffffffff81111561538757600080fd5b8501601f8101871361539857600080fd5b61522787823560208401614cd2565b600080600080600060a086880312156153bf57600080fd5b85356153ca81614a42565b945060208601359350604086013567ffffffffffffffff808211156153ee57600080fd5b6153fa89838a0161502b565b9450606088013591508082111561541057600080fd5b5061541d8882890161508d565b92505061542c60808701615017565b90509295509295909350565b600181811c9082168061544c57607f821691505b60208210810361546c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016154b0576154b0615488565b5060010190565b6000602082840312156154c957600080fd5b81516149bf8161498c565b80820180821115610be157610be1615488565b601f82111561142357600081815260208120601f850160051c8101602086101561550e5750805b601f850160051c820191505b8181101561552d5782815560010161551a565b505050505050565b815167ffffffffffffffff81111561554f5761554f614c62565b6155638161555d8454615438565b846154e7565b602080601f83116001811461559857600084156155805750858301515b600019600386901b1c1916600185901b17855561552d565b600085815260208120601f198616915b828110156155c7578886015182559484019460019091019084016155a8565b50858210156155e55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160601b0381811683821601908082111561561557615615615488565b5092915050565b6001600160601b0382811682821603908082111561561557615615615488565b63ffffffff82811682821603908082111561561557615615615488565b60006001600160a01b03808816835280871660208401525084604083015260806060830152826080830152828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b60008086546156bb81615438565b600182811680156156d357600181146156e857615717565b60ff1984168752821515830287019450615717565b8a60005260208060002060005b8581101561570e5781548a8201529084019082016156f5565b50505082870194505b50505050855161572b818360208a016149c6565b019384525050602082015260400192915050565b600063ffffffff80831681810361575857615758615488565b6001019392505050565b6060815260006157756060830186614b29565b63ffffffff85166020840152828103604084015261579381856149ea565b9695505050505050565b6000602082840312156157af57600080fd5b81516149bf81614a42565b8082028115828204841417610be157610be1615488565b63ffffffff81811683821601908082111561561557615615615488565b63ffffffff8181168382160280821691908281146140b0576140b0615488565b634e487b7160e01b600052601260045260246000fd5b6000826158335761583361580e565b500690565b6000826158475761584761580e565b50049056fea2646970667358221220ee3dd136eb9c3aaae80969db0d981f4555af6520415662932908c79dee30e48b64736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {} -} \ No newline at end of file diff --git a/scripts/service_hash.py b/scripts/service_hash.py index 27b9b8e..a99bad0 100644 --- a/scripts/service_hash.py +++ b/scripts/service_hash.py @@ -22,13 +22,19 @@ import json from typing import List +from pathlib import Path import requests from web3 import Web3, HTTPProvider -RPC_PATH = "../.trader_runner/rpc.txt" -SERVICE_ID_PATH = "../.trader_runner/service_id.txt" -REGISTRY_JSON = "../contracts/ServiceRegistryL2.json" +SCRIPT_PATH = Path(__file__).resolve().parent +STORE_PATH = Path(SCRIPT_PATH, "..", ".trader_runner") +DOTENV_PATH = Path(STORE_PATH, ".env") +RPC_PATH = Path(STORE_PATH, "rpc.txt") +SERVICE_ID_PATH = Path(STORE_PATH, "service_id.txt") +PACKAGES_PATH = Path(SCRIPT_PATH, "..", "trader", "packages") + +REGISTRY_JSON = PACKAGES_PATH / "valory" / "contracts" / "service_registry" / "build" / "ServiceRegistryL2.json" REGISTRY_ADDRESS = "0x9338b5153AE39BB89f50468E608eD9d764B755fD" AUTONOLAS_GATEWAY = "https://gateway.autonolas.tech/ipfs/" URI_HASH_POSITION = 7 diff --git a/scripts/staking.py b/scripts/staking.py index 15464b8..e4670f2 100644 --- a/scripts/staking.py +++ b/scripts/staking.py @@ -346,6 +346,16 @@ def main() -> None: f"Checking if the staking contract has any rewards..." ) else: + + # At this point must be ensured all these conditions + # + # USE_STAKING==True + # staking_state==Unstaked + # available_slots > 0 + # available_rewards > 0 + # staking params==OK + # state==DEPLOYED + _try_stake_service( ledger_api=ledger_api, service_id=args.service_id, From a7084a66c903058e22792a24963cfe2ebd5a8ae4 Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Sun, 25 Aug 2024 13:30:51 +0200 Subject: [PATCH 10/11] chore: remove unused file --- contracts/AgentMech.json | 614 --------------------------------------- 1 file changed, 614 deletions(-) delete mode 100644 contracts/AgentMech.json diff --git a/contracts/AgentMech.json b/contracts/AgentMech.json deleted file mode 100644 index 93ed959..0000000 --- a/contracts/AgentMech.json +++ /dev/null @@ -1,614 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "AgentMech", - "sourceName": "contracts/AgentMech.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_price", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "agentId", - "type": "uint256" - } - ], - "name": "AgentNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "provided", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - } - ], - "name": "NotEnoughPaid", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "requestId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "Deliver", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "taskHash", - "type": "bytes32" - } - ], - "name": "Perform", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - } - ], - "name": "PriceUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "requestId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "Request", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requestId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "deliver", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "entryPoint", - "outputs": [ - { - "internalType": "contract IEntryPoint", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "enum Enum.Operation", - "name": "operation", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "txGas", - "type": "uint256" - } - ], - "name": "exec", - "outputs": [ - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "getRequestId", - "outputs": [ - { - "internalType": "uint256", - "name": "requestId", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - } - ], - "name": "isOperator", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "isValidSignature", - "outputs": [ - { - "internalType": "bytes4", - "name": "magicValue", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nonce", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155BatchReceived", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC721Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "price", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "request", - "outputs": [ - { - "internalType": "uint256", - "name": "requestId", - "type": "uint256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newPrice", - "type": "uint256" - } - ], - "name": "setPrice", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "initParams", - "type": "bytes" - } - ], - "name": "setUp", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "contract IERC721", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenId", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "tokensReceived", - "outputs": [], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "initCode", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "callGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "verificationGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "preVerificationGas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFeePerGas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxPriorityFeePerGas", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "paymasterAndData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "internalType": "struct UserOperation", - "name": "userOp", - "type": "tuple" - }, - { - "internalType": "bytes32", - "name": "userOpHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "missingAccountFunds", - "type": "uint256" - } - ], - "name": "validateUserOp", - "outputs": [ - { - "internalType": "uint256", - "name": "validationData", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "bytecode": "0x6080604052600080553480156200001557600080fd5b5060405162001d4538038062001d4583398101604081905262000038916200039f565b604080516001600160a01b038516602082015280820184905281518082038301815260609091019091528390839062000071816200014a565b5050506001600160a01b0383166200009c5760405163d92e233d60e01b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018390526000906001600160a01b03851690636352211e90602401602060405180830381865afa158015620000e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200010b9190620003d7565b90506001600160a01b0381166200013d57604051630ede975960e01b8152600481018490526024015b60405180910390fd5b5060015550620004b39050565b62000154620001b2565b5115620001a45760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a656400000000000000000000000000604482015260640162000134565b620001af816200021f565b50565b60606200021a62000214604051606b60f91b6020820152602560fa1b60218201526001600160601b03193060601b166022820152600160f81b60368201526000906037016040516020818303038152906040528051906020012060001c905090565b620002ed565b905090565b60006200022c8262000346565b905060008151602083016000f0905062000297604051606b60f91b6020820152602560fa1b60218201526001600160601b03193060601b166022820152600160f81b60368201526000906037016040516020818303038152906040528051906020012060001c905090565b6001600160a01b0316816001600160a01b031614620002e85760405162461bcd60e51b815260206004820152600c60248201526b15dc9a5d194819985a5b195960a21b604482015260640162000134565b505050565b6060813b6001811162000310575050604080516020810190915260008152919050565b806200031c8162000412565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016200035891906200042c565b826040516020016200036c92919062000448565b6040516020818303038152906040529050919050565b80516001600160a01b03811681146200039a57600080fd5b919050565b600080600060608486031215620003b557600080fd5b620003c08462000382565b925060208401519150604084015190509250925092565b600060208284031215620003ea57600080fd5b620003f58262000382565b9392505050565b634e487b7160e01b600052601160045260246000fd5b600081620004245762000424620003fc565b506000190190565b80820180821115620004425762000442620003fc565b92915050565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b60058201526000600e82018190528251815b81811015620004a1576020818601810151600f86840101520162000482565b5060009201600f019182525092915050565b61188280620004c36000396000f3fe60806040526004361061012c5760003560e01c8063a4f9edbf116100a5578063bc197c8111610074578063e00b911811610059578063e00b911814610371578063f23a6e6114610391578063fc0c546a146103be57600080fd5b8063bc197c8114610315578063c7dec3fc1461034457600080fd5b8063a4f9edbf14610292578063affed0e0146102b2578063b0d691fe146102c7578063b94207d31461030257600080fd5b806317d70f7c116100fc5780636d70f7ae116100e15780636d70f7ae1461022c57806391b7f5ed1461025c578063a035b1fe1461027c57600080fd5b806317d70f7c146101e95780633a871cdd1461020c57600080fd5b806223de2914610138578063150b7a021461015f578063157305fe146101a95780631626ba7e146101c957600080fd5b3661013357005b600080fd5b34801561014457600080fd5b5061015d610153366004611118565b5050505050505050565b005b34801561016b57600080fd5b5061018b61017a3660046111c9565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020015b60405180910390f35b3480156101b557600080fd5b5061015d6101c43660046112df565b6103d3565b3480156101d557600080fd5b5061018b6101e43660046112df565b6104ae565b3480156101f557600080fd5b506101fe6105db565b6040519081526020016101a0565b34801561021857600080fd5b506101fe610227366004611326565b610600565b34801561023857600080fd5b5061024c61024736600461137a565b61063e565b60405190151581526020016101a0565b34801561026857600080fd5b5061015d610277366004611397565b6106ed565b34801561028857600080fd5b506101fe60015481565b34801561029e57600080fd5b5061015d6102ad3660046113b0565b6107c1565b3480156102be57600080fd5b506000546101fe565b3480156102d357600080fd5b50730576a174d229e3cfa37253523e645a78a0c91b575b6040516001600160a01b0390911681526020016101a0565b6101fe6103103660046113b0565b610823565b34801561032157600080fd5b5061018b610330366004611432565b63bc197c8160e01b98975050505050505050565b34801561035057600080fd5b5061036461035f3660046114d0565b6108a9565b6040516101a09190611598565b34801561037d57600080fd5b506101fe61038c3660046115ab565b61097a565b34801561039d57600080fd5b5061018b6103ac3660046115e5565b63f23a6e6160e01b9695505050505050565b3480156103ca57600080fd5b506102ea6109ae565b6103dc3361063e565b806103fa575033730576a174d229e3cfa37253523e645a78a0c91b57145b6104715760405162461bcd60e51b815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084015b60405180910390fd5b7f3ec84da2cdc1ce60c063642b69ff2e65f3b69787a2b90443457ba274e51e7c7282826040516104a2929190611661565b60405180910390a15050565b6000806000806104d1856020810151604082015160609092015160001a92909190565b9094509250905060ff811660000361059f57828583016020016104f38261063e565b15801561050957506001600160a01b0382163014155b1561052457506001600160e01b031994506105d59350505050565b604051630b135d3f60e11b81526001600160a01b03831690631626ba7e90610552908b908590600401611661565b602060405180830381865afa15801561056f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610593919061167a565b955050505050506105d5565b6105ae610247878386866109cc565b156105c65750630b135d3f60e11b92506105d5915050565b506001600160e01b0319925050505b92915050565b6000806105e66109ea565b8060200190518101906105f991906116a4565b9392505050565b600061060a610a59565b6106148484610abe565b905061062360408501856116d2565b90506000036106355761063584610b91565b6105f982610bf6565b600080600061064b6109ea565b80602001905181019061065e91906116a4565b91509150836001600160a01b0316826001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161069a91815260200190565b602060405180830381865afa1580156106b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106db9190611719565b6001600160a01b031614949350505050565b6106f63361063e565b80610714575033730576a174d229e3cfa37253523e645a78a0c91b57145b6107865760405162461bcd60e51b815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610468565b60018190556040518181527f66cbca4f3c64fecf1dcb9ce094abcf7f68c3450a1d4e3a8e917dd621edb4ebe09060200160405180910390a150565b6107c96109ea565b51156108175760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a6564000000000000000000000000006044820152606401610468565b61082081610c4f565b50565b6000600154341015610855576001546040516316912f0560e31b81523460048201526024810191909152604401610468565b61085f338361097a565b9050336001600160a01b03167f4bda649efe6b98b0f9c1d5e859c29e20910f45c66dabfe6fad4a4881f7faf9cc828460405161089c929190611661565b60405180910390a2919050565b60606108b43361063e565b806108d2575033730576a174d229e3cfa37253523e645a78a0c91b57145b6109445760405162461bcd60e51b815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610468565b600061095f8787878787156109595787610d2e565b5a610d2e565b925090508061097057815160208301fd5b5095945050505050565b6000828260405160200161098f929190611736565b60408051601f1981840301815291905280516020909101209392505050565b6000806109b96109ea565b8060200190518101906105d59190611719565b60008060006109dd87878787610e1e565b9150915061097081610ee2565b6060610a54610a4f604051606b60f91b6020820152602560fa1b60218201526bffffffffffffffffffffffff193060601b166022820152600160f81b60368201526000906037016040516020818303038152906040528051906020012060001c905090565b61102c565b905090565b33730576a174d229e3cfa37253523e645a78a0c91b5714610abc5760405162461bcd60e51b815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610468565b565b600080610b18836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050630b135d3f60e11b610b6e82610b346101408801886116d2565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506104ae92505050565b6001600160e01b03191614610b875760019150506105d5565b5060009392505050565b6000805460208301359180610ba58361176e565b91905055146108205760405162461bcd60e51b815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610468565b801561082057604051600090339060001990849084818181858888f193505050503d8060008114610c43576040519150601f19603f3d011682016040523d82523d6000602084013e610c48565b606091505b5050505050565b6000610c5a82611082565b905060008151602083016000f09050610cc9604051606b60f91b6020820152602560fa1b60218201526bffffffffffffffffffffffff193060601b166022820152600160f81b60368201526000906037016040516020818303038152906040528051906020012060001c905090565b6001600160a01b0316816001600160a01b031614610d295760405162461bcd60e51b815260206004820152600c60248201527f5772697465206661696c656400000000000000000000000000000000000000006044820152606401610468565b505050565b600060606001846001811115610d4657610d46611787565b03610db057866001600160a01b03168386604051610d64919061179d565b6000604051808303818686f4925050503d8060008114610da0576040519150601f19603f3d011682016040523d82523d6000602084013e610da5565b606091505b509092509050610e14565b866001600160a01b0316838787604051610dca919061179d565b600060405180830381858888f193505050503d8060008114610e08576040519150601f19603f3d011682016040523d82523d6000602084013e610e0d565b606091505b5090925090505b9550959350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610e555750600090506003610ed9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610ea9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ed257600060019250925050610ed9565b9150600090505b94509492505050565b6000816004811115610ef657610ef6611787565b03610efe5750565b6001816004811115610f1257610f12611787565b03610f5f5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610468565b6002816004811115610f7357610f73611787565b03610fc05760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610468565b6003816004811115610fd457610fd4611787565b036108205760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610468565b6060813b6001811161104e575050604080516020810190915260008152919050565b80611058816117b9565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b60608151600161109291906117d0565b826040516020016110a49291906117e3565b6040516020818303038152906040529050919050565b6001600160a01b038116811461082057600080fd5b60008083601f8401126110e157600080fd5b50813567ffffffffffffffff8111156110f957600080fd5b60208301915083602082850101111561111157600080fd5b9250929050565b60008060008060008060008060c0898b03121561113457600080fd5b883561113f816110ba565b9750602089013561114f816110ba565b9650604089013561115f816110ba565b955060608901359450608089013567ffffffffffffffff8082111561118357600080fd5b61118f8c838d016110cf565b909650945060a08b01359150808211156111a857600080fd5b506111b58b828c016110cf565b999c989b5096995094979396929594505050565b6000806000806000608086880312156111e157600080fd5b85356111ec816110ba565b945060208601356111fc816110ba565b935060408601359250606086013567ffffffffffffffff81111561121f57600080fd5b61122b888289016110cf565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261126357600080fd5b813567ffffffffffffffff8082111561127e5761127e61123c565b604051601f8301601f19908116603f011681019082821181831017156112a6576112a661123c565b816040528381528660208588010111156112bf57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156112f257600080fd5b82359150602083013567ffffffffffffffff81111561131057600080fd5b61131c85828601611252565b9150509250929050565b60008060006060848603121561133b57600080fd5b833567ffffffffffffffff81111561135257600080fd5b8401610160818703121561136557600080fd5b95602085013595506040909401359392505050565b60006020828403121561138c57600080fd5b81356105f9816110ba565b6000602082840312156113a957600080fd5b5035919050565b6000602082840312156113c257600080fd5b813567ffffffffffffffff8111156113d957600080fd5b6113e584828501611252565b949350505050565b60008083601f8401126113ff57600080fd5b50813567ffffffffffffffff81111561141757600080fd5b6020830191508360208260051b850101111561111157600080fd5b60008060008060008060008060a0898b03121561144e57600080fd5b8835611459816110ba565b97506020890135611469816110ba565b9650604089013567ffffffffffffffff8082111561148657600080fd5b6114928c838d016113ed565b909850965060608b01359150808211156114ab57600080fd5b6114b78c838d016113ed565b909650945060808b01359150808211156111a857600080fd5b600080600080600060a086880312156114e857600080fd5b85356114f3816110ba565b945060208601359350604086013567ffffffffffffffff81111561151657600080fd5b61152288828901611252565b93505060608601356002811061153757600080fd5b949793965091946080013592915050565b60005b8381101561156357818101518382015260200161154b565b50506000910152565b60008151808452611584816020860160208601611548565b601f01601f19169290920160200192915050565b6020815260006105f9602083018461156c565b600080604083850312156115be57600080fd5b82356115c9816110ba565b9150602083013567ffffffffffffffff81111561131057600080fd5b60008060008060008060a087890312156115fe57600080fd5b8635611609816110ba565b95506020870135611619816110ba565b94506040870135935060608701359250608087013567ffffffffffffffff81111561164357600080fd5b61164f89828a016110cf565b979a9699509497509295939492505050565b8281526040602082015260006113e5604083018461156c565b60006020828403121561168c57600080fd5b81516001600160e01b0319811681146105f957600080fd5b600080604083850312156116b757600080fd5b82516116c2816110ba565b6020939093015192949293505050565b6000808335601e198436030181126116e957600080fd5b83018035915067ffffffffffffffff82111561170457600080fd5b60200191503681900382131561111157600080fd5b60006020828403121561172b57600080fd5b81516105f9816110ba565b6001600160a01b03831681526040602082015260006113e5604083018461156c565b634e487b7160e01b600052601160045260246000fd5b60006001820161178057611780611758565b5060010190565b634e487b7160e01b600052602160045260246000fd5b600082516117af818460208701611548565b9190910192915050565b6000816117c8576117c8611758565b506000190190565b808201808211156105d5576105d5611758565b606360f81b815263ffffffff60e01b8360e01b1660018201527f80600e6000396000f3000000000000000000000000000000000000000000000060058201526000600e8201526000825161183e81600f850160208701611548565b91909101600f01939250505056fea26469706673582212202a03e14f0f05f58be9cbbba4646c39d989209350f0ee3edaaf0da00994a368d164736f6c63430008130033", - "deployedBytecode": "0x60806040526004361061012c5760003560e01c8063a4f9edbf116100a5578063bc197c8111610074578063e00b911811610059578063e00b911814610371578063f23a6e6114610391578063fc0c546a146103be57600080fd5b8063bc197c8114610315578063c7dec3fc1461034457600080fd5b8063a4f9edbf14610292578063affed0e0146102b2578063b0d691fe146102c7578063b94207d31461030257600080fd5b806317d70f7c116100fc5780636d70f7ae116100e15780636d70f7ae1461022c57806391b7f5ed1461025c578063a035b1fe1461027c57600080fd5b806317d70f7c146101e95780633a871cdd1461020c57600080fd5b806223de2914610138578063150b7a021461015f578063157305fe146101a95780631626ba7e146101c957600080fd5b3661013357005b600080fd5b34801561014457600080fd5b5061015d610153366004611118565b5050505050505050565b005b34801561016b57600080fd5b5061018b61017a3660046111c9565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020015b60405180910390f35b3480156101b557600080fd5b5061015d6101c43660046112df565b6103d3565b3480156101d557600080fd5b5061018b6101e43660046112df565b6104ae565b3480156101f557600080fd5b506101fe6105db565b6040519081526020016101a0565b34801561021857600080fd5b506101fe610227366004611326565b610600565b34801561023857600080fd5b5061024c61024736600461137a565b61063e565b60405190151581526020016101a0565b34801561026857600080fd5b5061015d610277366004611397565b6106ed565b34801561028857600080fd5b506101fe60015481565b34801561029e57600080fd5b5061015d6102ad3660046113b0565b6107c1565b3480156102be57600080fd5b506000546101fe565b3480156102d357600080fd5b50730576a174d229e3cfa37253523e645a78a0c91b575b6040516001600160a01b0390911681526020016101a0565b6101fe6103103660046113b0565b610823565b34801561032157600080fd5b5061018b610330366004611432565b63bc197c8160e01b98975050505050505050565b34801561035057600080fd5b5061036461035f3660046114d0565b6108a9565b6040516101a09190611598565b34801561037d57600080fd5b506101fe61038c3660046115ab565b61097a565b34801561039d57600080fd5b5061018b6103ac3660046115e5565b63f23a6e6160e01b9695505050505050565b3480156103ca57600080fd5b506102ea6109ae565b6103dc3361063e565b806103fa575033730576a174d229e3cfa37253523e645a78a0c91b57145b6104715760405162461bcd60e51b815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084015b60405180910390fd5b7f3ec84da2cdc1ce60c063642b69ff2e65f3b69787a2b90443457ba274e51e7c7282826040516104a2929190611661565b60405180910390a15050565b6000806000806104d1856020810151604082015160609092015160001a92909190565b9094509250905060ff811660000361059f57828583016020016104f38261063e565b15801561050957506001600160a01b0382163014155b1561052457506001600160e01b031994506105d59350505050565b604051630b135d3f60e11b81526001600160a01b03831690631626ba7e90610552908b908590600401611661565b602060405180830381865afa15801561056f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610593919061167a565b955050505050506105d5565b6105ae610247878386866109cc565b156105c65750630b135d3f60e11b92506105d5915050565b506001600160e01b0319925050505b92915050565b6000806105e66109ea565b8060200190518101906105f991906116a4565b9392505050565b600061060a610a59565b6106148484610abe565b905061062360408501856116d2565b90506000036106355761063584610b91565b6105f982610bf6565b600080600061064b6109ea565b80602001905181019061065e91906116a4565b91509150836001600160a01b0316826001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161069a91815260200190565b602060405180830381865afa1580156106b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106db9190611719565b6001600160a01b031614949350505050565b6106f63361063e565b80610714575033730576a174d229e3cfa37253523e645a78a0c91b57145b6107865760405162461bcd60e51b815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610468565b60018190556040518181527f66cbca4f3c64fecf1dcb9ce094abcf7f68c3450a1d4e3a8e917dd621edb4ebe09060200160405180910390a150565b6107c96109ea565b51156108175760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a6564000000000000000000000000006044820152606401610468565b61082081610c4f565b50565b6000600154341015610855576001546040516316912f0560e31b81523460048201526024810191909152604401610468565b61085f338361097a565b9050336001600160a01b03167f4bda649efe6b98b0f9c1d5e859c29e20910f45c66dabfe6fad4a4881f7faf9cc828460405161089c929190611661565b60405180910390a2919050565b60606108b43361063e565b806108d2575033730576a174d229e3cfa37253523e645a78a0c91b57145b6109445760405162461bcd60e51b815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610468565b600061095f8787878787156109595787610d2e565b5a610d2e565b925090508061097057815160208301fd5b5095945050505050565b6000828260405160200161098f929190611736565b60408051601f1981840301815291905280516020909101209392505050565b6000806109b96109ea565b8060200190518101906105d59190611719565b60008060006109dd87878787610e1e565b9150915061097081610ee2565b6060610a54610a4f604051606b60f91b6020820152602560fa1b60218201526bffffffffffffffffffffffff193060601b166022820152600160f81b60368201526000906037016040516020818303038152906040528051906020012060001c905090565b61102c565b905090565b33730576a174d229e3cfa37253523e645a78a0c91b5714610abc5760405162461bcd60e51b815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610468565b565b600080610b18836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050630b135d3f60e11b610b6e82610b346101408801886116d2565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506104ae92505050565b6001600160e01b03191614610b875760019150506105d5565b5060009392505050565b6000805460208301359180610ba58361176e565b91905055146108205760405162461bcd60e51b815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610468565b801561082057604051600090339060001990849084818181858888f193505050503d8060008114610c43576040519150601f19603f3d011682016040523d82523d6000602084013e610c48565b606091505b5050505050565b6000610c5a82611082565b905060008151602083016000f09050610cc9604051606b60f91b6020820152602560fa1b60218201526bffffffffffffffffffffffff193060601b166022820152600160f81b60368201526000906037016040516020818303038152906040528051906020012060001c905090565b6001600160a01b0316816001600160a01b031614610d295760405162461bcd60e51b815260206004820152600c60248201527f5772697465206661696c656400000000000000000000000000000000000000006044820152606401610468565b505050565b600060606001846001811115610d4657610d46611787565b03610db057866001600160a01b03168386604051610d64919061179d565b6000604051808303818686f4925050503d8060008114610da0576040519150601f19603f3d011682016040523d82523d6000602084013e610da5565b606091505b509092509050610e14565b866001600160a01b0316838787604051610dca919061179d565b600060405180830381858888f193505050503d8060008114610e08576040519150601f19603f3d011682016040523d82523d6000602084013e610e0d565b606091505b5090925090505b9550959350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610e555750600090506003610ed9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610ea9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ed257600060019250925050610ed9565b9150600090505b94509492505050565b6000816004811115610ef657610ef6611787565b03610efe5750565b6001816004811115610f1257610f12611787565b03610f5f5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610468565b6002816004811115610f7357610f73611787565b03610fc05760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610468565b6003816004811115610fd457610fd4611787565b036108205760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610468565b6060813b6001811161104e575050604080516020810190915260008152919050565b80611058816117b9565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b60608151600161109291906117d0565b826040516020016110a49291906117e3565b6040516020818303038152906040529050919050565b6001600160a01b038116811461082057600080fd5b60008083601f8401126110e157600080fd5b50813567ffffffffffffffff8111156110f957600080fd5b60208301915083602082850101111561111157600080fd5b9250929050565b60008060008060008060008060c0898b03121561113457600080fd5b883561113f816110ba565b9750602089013561114f816110ba565b9650604089013561115f816110ba565b955060608901359450608089013567ffffffffffffffff8082111561118357600080fd5b61118f8c838d016110cf565b909650945060a08b01359150808211156111a857600080fd5b506111b58b828c016110cf565b999c989b5096995094979396929594505050565b6000806000806000608086880312156111e157600080fd5b85356111ec816110ba565b945060208601356111fc816110ba565b935060408601359250606086013567ffffffffffffffff81111561121f57600080fd5b61122b888289016110cf565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261126357600080fd5b813567ffffffffffffffff8082111561127e5761127e61123c565b604051601f8301601f19908116603f011681019082821181831017156112a6576112a661123c565b816040528381528660208588010111156112bf57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156112f257600080fd5b82359150602083013567ffffffffffffffff81111561131057600080fd5b61131c85828601611252565b9150509250929050565b60008060006060848603121561133b57600080fd5b833567ffffffffffffffff81111561135257600080fd5b8401610160818703121561136557600080fd5b95602085013595506040909401359392505050565b60006020828403121561138c57600080fd5b81356105f9816110ba565b6000602082840312156113a957600080fd5b5035919050565b6000602082840312156113c257600080fd5b813567ffffffffffffffff8111156113d957600080fd5b6113e584828501611252565b949350505050565b60008083601f8401126113ff57600080fd5b50813567ffffffffffffffff81111561141757600080fd5b6020830191508360208260051b850101111561111157600080fd5b60008060008060008060008060a0898b03121561144e57600080fd5b8835611459816110ba565b97506020890135611469816110ba565b9650604089013567ffffffffffffffff8082111561148657600080fd5b6114928c838d016113ed565b909850965060608b01359150808211156114ab57600080fd5b6114b78c838d016113ed565b909650945060808b01359150808211156111a857600080fd5b600080600080600060a086880312156114e857600080fd5b85356114f3816110ba565b945060208601359350604086013567ffffffffffffffff81111561151657600080fd5b61152288828901611252565b93505060608601356002811061153757600080fd5b949793965091946080013592915050565b60005b8381101561156357818101518382015260200161154b565b50506000910152565b60008151808452611584816020860160208601611548565b601f01601f19169290920160200192915050565b6020815260006105f9602083018461156c565b600080604083850312156115be57600080fd5b82356115c9816110ba565b9150602083013567ffffffffffffffff81111561131057600080fd5b60008060008060008060a087890312156115fe57600080fd5b8635611609816110ba565b95506020870135611619816110ba565b94506040870135935060608701359250608087013567ffffffffffffffff81111561164357600080fd5b61164f89828a016110cf565b979a9699509497509295939492505050565b8281526040602082015260006113e5604083018461156c565b60006020828403121561168c57600080fd5b81516001600160e01b0319811681146105f957600080fd5b600080604083850312156116b757600080fd5b82516116c2816110ba565b6020939093015192949293505050565b6000808335601e198436030181126116e957600080fd5b83018035915067ffffffffffffffff82111561170457600080fd5b60200191503681900382131561111157600080fd5b60006020828403121561172b57600080fd5b81516105f9816110ba565b6001600160a01b03831681526040602082015260006113e5604083018461156c565b634e487b7160e01b600052601160045260246000fd5b60006001820161178057611780611758565b5060010190565b634e487b7160e01b600052602160045260246000fd5b600082516117af818460208701611548565b9190910192915050565b6000816117c8576117c8611758565b506000190190565b808201808211156105d5576105d5611758565b606360f81b815263ffffffff60e01b8360e01b1660018201527f80600e6000396000f3000000000000000000000000000000000000000000000060058201526000600e8201526000825161183e81600f850160208701611548565b91909101600f01939250505056fea26469706673582212202a03e14f0f05f58be9cbbba4646c39d989209350f0ee3edaaf0da00994a368d164736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {} -} From effa9241d83c8b99b13df9c445c85cfbd4902f33 Mon Sep 17 00:00:00 2001 From: jmoreira-valory Date: Sun, 25 Aug 2024 15:04:15 +0200 Subject: [PATCH 11/11] chore: remove duplicate code --- contracts/wxdai.json | 279 --------------------------------------- scripts/erc20_balance.py | 7 +- 2 files changed, 5 insertions(+), 281 deletions(-) delete mode 100644 contracts/wxdai.json diff --git a/contracts/wxdai.json b/contracts/wxdai.json deleted file mode 100644 index e171f9e..0000000 --- a/contracts/wxdai.json +++ /dev/null @@ -1,279 +0,0 @@ -[ - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "guy", - "type": "address" - }, - { - "name": "wad", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "src", - "type": "address" - }, - { - "name": "dst", - "type": "address" - }, - { - "name": "wad", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "wad", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dst", - "type": "address" - }, - { - "name": "wad", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "deposit", - "outputs": [], - "payable": true, - "stateMutability": "payable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "address" - }, - { - "name": "", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "payable": true, - "stateMutability": "payable", - "type": "fallback" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "src", - "type": "address" - }, - { - "indexed": true, - "name": "guy", - "type": "address" - }, - { - "indexed": false, - "name": "wad", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "src", - "type": "address" - }, - { - "indexed": true, - "name": "dst", - "type": "address" - }, - { - "indexed": false, - "name": "wad", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "dst", - "type": "address" - }, - { - "indexed": false, - "name": "wad", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "src", - "type": "address" - }, - { - "indexed": false, - "name": "wad", - "type": "uint256" - } - ], - "name": "Withdrawal", - "type": "event" - } -] diff --git a/scripts/erc20_balance.py b/scripts/erc20_balance.py index 6d79773..64b5712 100644 --- a/scripts/erc20_balance.py +++ b/scripts/erc20_balance.py @@ -20,12 +20,13 @@ """This script prints the wxDAI balance of an address in WEI.""" +import json import sys from web3 import Web3, HTTPProvider WXDAI_CONTRACT_ADDRESS = "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d" -WXDAI_ABI_PATH = "../contracts/wxdai.json" +WXDAI_ABI_PATH = "../trader/packages/valory/contracts/erc20/build/ERC20.json" def get_balance() -> int: @@ -38,7 +39,9 @@ def get_balance() -> int: def read_abi() -> str: """Read and return the wxDAI contract's ABI.""" with open(WXDAI_ABI_PATH) as f: - return f.read() + data = json.loads(f.read()) + + return data.get('abi', []) if __name__ == "__main__":