pet-operator
Set or revoke AAI as pet operator for user wallets, and keep delegation bookkeeping aligned.
Constants
- - AAI operator wallet: INLINECODE0
- Aavegotchi Diamond: INLINECODE1
- Chain: Base mainnet (
8453) - RPC default: INLINECODE3
Overridable env:
- - INLINECODE4
- INLINECODE5
- INLINECODE6
- INLINECODE7
Scripts
- Checks
isPetOperatorForAll(owner, operator).
- Generates call data for
setPetOperatorForAll(AAI_OPERATOR, true).
- Generates call data for
setPetOperatorForAll(AAI_OPERATOR, false).
- Verifies approval, fetches owned gotchi IDs, upserts into
pet-me-master config.
- Removes wallet bookkeeping entries from config.
Config Bookkeeping
INLINECODE17 writes to:
- -
.delegatedWallets (preferred) - INLINECODE19 (legacy compatibility, only if present)
This does not grant on-chain permissions by itself; on-chain approval must already exist.
Security
- - Operator permission only enables petting, not transfer.
- User keeps full ownership.
- Revocation is one on-chain tx away.
pet-operator
为用户钱包设置或撤销AAI宠物操作员权限,并保持委托记账同步。
常量
- - AAI操作员钱包:0xb96B48a6B190A9d509cE9312654F34E9770F2110
- Aavegotchi钻石合约:0xA99c4B08201F2913Db8D28e71d020c4298F29dBF
- 链:Base主网(8453)
- RPC默认地址:https://mainnet.base.org
可覆盖环境变量:
- - AAVEGOTCHIDIAMOND
- AAIOPERATOR
- BASERPCURL
- PETMECONFIG_FILE
脚本
- - ./scripts/check-approval.sh <钱包地址>
- 检查 isPetOperatorForAll(owner, operator)。
- - ./scripts/generate-delegation-tx.sh <钱包地址>
- 生成 setPetOperatorForAll(AAI_OPERATOR, true) 的调用数据。
- - ./scripts/generate-revoke-tx.sh <钱包地址>
- 生成 setPetOperatorForAll(AAI_OPERATOR, false) 的调用数据。
- - ./scripts/add-delegated-wallet.sh <钱包地址> [名称]
- 验证授权,获取拥有的Gotchi ID,更新到 pet-me-master 配置中。
- - ./scripts/remove-delegated-wallet.sh <钱包地址>
- 从配置中移除钱包记账条目。
配置记账
add-delegated-wallet.sh 写入到:
- - .delegatedWallets(推荐)
- .wallets(旧版兼容,仅当存在时)
此操作本身不会授予链上权限;链上授权必须已存在。
安全性
- - 操作员权限仅允许宠物互动,不可转移。
- 用户保留完全所有权。
- 撤销只需一次链上交易。