@clawlogic/sdk 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +26 -2
  2. package/dist/bridge.d.ts +84 -0
  3. package/dist/bridge.d.ts.map +1 -0
  4. package/dist/bridge.js +99 -0
  5. package/dist/bridge.js.map +1 -0
  6. package/dist/cli/args.d.ts +9 -0
  7. package/dist/cli/args.d.ts.map +1 -0
  8. package/dist/cli/args.js +47 -0
  9. package/dist/cli/args.js.map +1 -0
  10. package/dist/cli/constants.d.ts +12 -0
  11. package/dist/cli/constants.d.ts.map +1 -0
  12. package/dist/cli/constants.js +13 -0
  13. package/dist/cli/constants.js.map +1 -0
  14. package/dist/cli/index.d.ts +3 -0
  15. package/dist/cli/index.d.ts.map +1 -0
  16. package/dist/cli/index.js +531 -0
  17. package/dist/cli/index.js.map +1 -0
  18. package/dist/cli/output.d.ts +5 -0
  19. package/dist/cli/output.d.ts.map +1 -0
  20. package/dist/cli/output.js +23 -0
  21. package/dist/cli/output.js.map +1 -0
  22. package/dist/cli/runtime.d.ts +25 -0
  23. package/dist/cli/runtime.d.ts.map +1 -0
  24. package/dist/cli/runtime.js +104 -0
  25. package/dist/cli/runtime.js.map +1 -0
  26. package/dist/client.d.ts +19 -2
  27. package/dist/client.d.ts.map +1 -1
  28. package/dist/client.js +56 -2
  29. package/dist/client.js.map +1 -1
  30. package/dist/identity.d.ts +9 -1
  31. package/dist/identity.d.ts.map +1 -1
  32. package/dist/identity.js +60 -9
  33. package/dist/identity.js.map +1 -1
  34. package/dist/index.d.ts +2 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +1 -0
  37. package/dist/index.js.map +1 -1
  38. package/package.json +6 -3
  39. package/src/abis/AgentRegistry.json +1 -1
  40. package/src/abis/ENSAgentHelper.json +1 -1
  41. package/src/abis/OutcomeToken.json +1 -1
  42. package/src/abis/PredictionMarketHook.json +1 -1
  43. package/src/bridge.ts +193 -0
  44. package/src/cli/args.ts +66 -0
  45. package/src/cli/constants.ts +19 -0
  46. package/src/cli/index.ts +620 -0
  47. package/src/cli/output.ts +26 -0
  48. package/src/cli/runtime.ts +157 -0
  49. package/src/client.ts +70 -1
  50. package/src/identity.ts +76 -9
  51. package/src/index.ts +14 -0
@@ -1 +1 @@
1
- {"abi":[{"type":"constructor","inputs":[{"name":"ensRegistry_","type":"address","internalType":"contract IENS"},{"name":"baseNode_","type":"bytes32","internalType":"bytes32"},{"name":"agentRegistry_","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"function","name":"computeSubnode","inputs":[{"name":"subdomain","type":"string","internalType":"string"}],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"i_agentRegistry","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"i_baseNode","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"i_ensRegistry","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IENS"}],"stateMutability":"view"},{"type":"function","name":"registerAgentSubdomain","inputs":[{"name":"subdomain","type":"string","internalType":"string"},{"name":"owner","type":"address","internalType":"address"}],"outputs":[{"name":"subnode","type":"bytes32","internalType":"bytes32"}],"stateMutability":"nonpayable"},{"type":"event","name":"AgentSubdomainRegistered","inputs":[{"name":"subdomain","type":"string","indexed":false,"internalType":"string"},{"name":"owner","type":"address","indexed":true,"internalType":"address"},{"name":"subnode","type":"bytes32","indexed":true,"internalType":"bytes32"}],"anonymous":false},{"type":"error","name":"EmptySubdomain","inputs":[]},{"type":"error","name":"OnlyAgentRegistry","inputs":[]},{"type":"error","name":"ZeroAddress","inputs":[]}],"bytecode":{"object":"0x60e0346100ba57601f61055638819003918201601f19168301916001600160401b038311848410176100be578084926060946040528339810103126100ba578051906001600160a01b03821682036100ba576020810151604090910151916001600160a01b03831683036100ba5760805260a05260c05260405161048390816100d38239608051818181606501526101b3015260a05181818160af015281816101770152610363015260c05181818161011b01526102e80152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60806040526004361015610011575f80fd5b5f3560e01c806315744e8d146103175780634eaeca32146102d35780636aae2f76146100d257806392cd341e146100985763964bee7214610050575f80fd5b34610094575f366003190112610094576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5f80fd5b34610094575f3660031901126100945760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100945760403660031901126100945760043567ffffffffffffffff8111610094576101039036906004016103a3565b906024356001600160a01b03811690819003610094577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036102c45782156102b55780156102a657610160368484610407565b80516020918201206040516306ab592360e01b81527f000000000000000000000000000000000000000000000000000000000000000060048201526024810191909152604481018390529290836064815f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af192831561029b575f93610243575b50907f9e90b787cc25043fa3d46409edffd5a567d3c2d451586f8d8f4b109dfd66a7f9846040859460209782519384928a8452818b850152848401375f828201840152601f01601f19168101030190a3604051908152f35b939250906020843d602011610293575b81610260602093836103d1565b810103126100945792519192907f9e90b787cc25043fa3d46409edffd5a567d3c2d451586f8d8f4b109dfd66a7f96101eb565b3d9150610253565b6040513d5f823e3d90fd5b63d92e233d60e01b5f5260045ffd5b631152713b60e21b5f5260045ffd5b6304052e6560e21b5f5260045ffd5b34610094575f366003190112610094576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346100945760203660031901126100945760043567ffffffffffffffff81116100945761035461034d60209236906004016103a3565b3691610407565b818151910120604051828101917f000000000000000000000000000000000000000000000000000000000000000083526040820152604081526103986060826103d1565b519020604051908152f35b9181601f840112156100945782359167ffffffffffffffff8311610094576020838186019501011161009457565b90601f8019910116810190811067ffffffffffffffff8211176103f357604052565b634e487b7160e01b5f52604160045260245ffd5b92919267ffffffffffffffff82116103f35760405191610431601f8201601f1916602001846103d1565b829481845281830111610094578281602093845f96013701015256fea26469706673582212206db912caaadee1bd5e8bc483f5b7c4e6378822e48875e57435ff723e37943cd364736f6c634300081a0033","sourceMap":"1238:5134:96:-:0;;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;-1:-1:-1;;;;;1238:5134:96;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1238:5134:96;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1238:5134:96;;;;;;3429:28;;3467:22;;3499:32;;1238:5134;;;;;;;;3429:28;1238:5134;;;;;;;;;;3467:22;1238:5134;;;;;;;;;;;;;;;3499:32;1238:5134;;;;;;;;;;;;-1:-1:-1;1238:5134:96;;;;;;-1:-1:-1;1238:5134:96;;;;;-1:-1:-1;1238:5134:96","linkReferences":{}},"deployedBytecode":{"object":"0x60806040526004361015610011575f80fd5b5f3560e01c806315744e8d146103175780634eaeca32146102d35780636aae2f76146100d257806392cd341e146100985763964bee7214610050575f80fd5b34610094575f366003190112610094576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5f80fd5b34610094575f3660031901126100945760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100945760403660031901126100945760043567ffffffffffffffff8111610094576101039036906004016103a3565b906024356001600160a01b03811690819003610094577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036102c45782156102b55780156102a657610160368484610407565b80516020918201206040516306ab592360e01b81527f000000000000000000000000000000000000000000000000000000000000000060048201526024810191909152604481018390529290836064815f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af192831561029b575f93610243575b50907f9e90b787cc25043fa3d46409edffd5a567d3c2d451586f8d8f4b109dfd66a7f9846040859460209782519384928a8452818b850152848401375f828201840152601f01601f19168101030190a3604051908152f35b939250906020843d602011610293575b81610260602093836103d1565b810103126100945792519192907f9e90b787cc25043fa3d46409edffd5a567d3c2d451586f8d8f4b109dfd66a7f96101eb565b3d9150610253565b6040513d5f823e3d90fd5b63d92e233d60e01b5f5260045ffd5b631152713b60e21b5f5260045ffd5b6304052e6560e21b5f5260045ffd5b34610094575f366003190112610094576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346100945760203660031901126100945760043567ffffffffffffffff81116100945761035461034d60209236906004016103a3565b3691610407565b818151910120604051828101917f000000000000000000000000000000000000000000000000000000000000000083526040820152604081526103986060826103d1565b519020604051908152f35b9181601f840112156100945782359167ffffffffffffffff8311610094576020838186019501011161009457565b90601f8019910116810190811067ffffffffffffffff8211176103f357604052565b634e487b7160e01b5f52604160045260245ffd5b92919267ffffffffffffffff82116103f35760405191610431601f8201601f1916602001846103d1565b829481845281830111610094578281602093845f96013701015256fea26469706673582212206db912caaadee1bd5e8bc483f5b7c4e6378822e48875e57435ff723e37943cd364736f6c634300081a0033","sourceMap":"1238:5134:96:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;;;2433:35;-1:-1:-1;;;;;1238:5134:96;;;;;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;;;;2555:35;1238:5134;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;;;;;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;1238:5134:96;;;;;;;;4783:15;-1:-1:-1;;;;;1238:5134:96;4769:10;:29;4765:86;;4865:28;;4861:82;;4957:19;;4953:70;;1238:5134;;;;;:::i;:::-;;;;;;;5302:27;1238:5134;;-1:-1:-1;;;5508:59:96;;5538:10;1238:5134;5508:59;;1238:5134;;;;;;;;;;;;;;;;;5508:59;1238:5134;-1:-1:-1;5508:13:96;-1:-1:-1;;;;;1238:5134:96;5508:59;;;;;;;1238:5134;5508:59;;;1238:5134;;;5783:51;1238:5134;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;5783:51;;;;1238:5134;;;;;;5508:59;;;;;1238:5134;5508:59;;1238:5134;5508:59;;;;;;1238:5134;5508:59;;;:::i;:::-;;;1238:5134;;;;;;;;5508:59;5783:51;5508:59;;;;;-1:-1:-1;5508:59:96;;;1238:5134;;;;;;;;;4953:70;4999:13;;;1238:5134;4999:13;1238:5134;;4999:13;4861:82;4916:16;;;1238:5134;4916:16;1238:5134;;4916:16;4765:86;4821:19;;;1238:5134;4821:19;1238:5134;;4821:19;1238:5134;;;;;;-1:-1:-1;;1238:5134:96;;;;;;2692:40;-1:-1:-1;;;;;1238:5134:96;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::i;:::-;;;;;;6269:27;1238:5134;;6323:39;;;6340:10;;1238:5134;;;;;;;6323:39;;;;;;:::i;:::-;1238:5134;6313:50;;1238:5134;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;-1:-1:-1;1238:5134:96;;;;;-1:-1:-1;1238:5134:96;;;;;;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;;:::i;:::-;;;;;;;;;;;;;;;;;-1:-1:-1;1238:5134:96;;;;;;:::o","linkReferences":{},"immutableReferences":{"60088":[{"start":101,"length":32},{"start":435,"length":32}],"60091":[{"start":175,"length":32},{"start":375,"length":32},{"start":867,"length":32}],"60094":[{"start":283,"length":32},{"start":744,"length":32}]}},"methodIdentifiers":{"computeSubnode(string)":"15744e8d","i_agentRegistry()":"4eaeca32","i_baseNode()":"92cd341e","i_ensRegistry()":"964bee72","registerAgentSubdomain(string,address)":"6aae2f76"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.26+commit.8a97fa7a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IENS\",\"name\":\"ensRegistry_\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"baseNode_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"agentRegistry_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"EmptySubdomain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyAgentRegistry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"subdomain\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subnode\",\"type\":\"bytes32\"}],\"name\":\"AgentSubdomainRegistered\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"subdomain\",\"type\":\"string\"}],\"name\":\"computeSubnode\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_agentRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_baseNode\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_ensRegistry\",\"outputs\":[{\"internalType\":\"contract IENS\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"subdomain\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"registerAgentSubdomain\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"subnode\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"$CLAWLOGIC Team\",\"details\":\"This contract must own the `agent.eth` parent node in the ENS Registry (or whichever base node is configured). It creates subdomains on behalf of the AgentRegistry, so that when an agent registers as \\\"alpha\\\", the helper can automatically provision `alpha.agent.eth` and assign ownership to the agent's address. **Access Control:** Only the designated AgentRegistry contract may call `registerAgentSubdomain()`. This prevents unauthorized subdomain creation. **ENS Namehash Calculation:** - `agent.eth` = namehash(\\\"agent.eth\\\") = keccak256(abi.encodePacked(namehash(\\\"eth\\\"), keccak256(\\\"agent\\\"))) - `alpha.agent.eth` = keccak256(abi.encodePacked(baseNode, keccak256(\\\"alpha\\\"))) The caller is responsible for computing the correct base node off-chain or in the deploy script. The full subnode is computed on-chain from `baseNode + label`.\",\"events\":{\"AgentSubdomainRegistered(string,address,bytes32)\":{\"params\":{\"owner\":\"The address assigned as the owner of the subdomain\",\"subdomain\":\"The human-readable subdomain label (e.g., \\\"alpha\\\")\",\"subnode\":\"The full ENS namehash of the registered subdomain\"}}},\"kind\":\"dev\",\"methods\":{\"computeSubnode(string)\":{\"details\":\"Pure helper for off-chain tooling and verification. Does not modify state.\",\"params\":{\"subdomain\":\"The subdomain label (e.g., \\\"alpha\\\").\"},\"returns\":{\"_0\":\"The full ENS namehash (e.g., namehash(\\\"alpha.agent.eth\\\")).\"}},\"constructor\":{\"details\":\"After deployment, the deployer must transfer ownership of `baseNode` in the ENS Registry to this contract's address so it can call `setSubnodeOwner`.\",\"params\":{\"agentRegistry_\":\"The AgentRegistry address authorized to request subdomain creation.\",\"baseNode_\":\"The namehash of the parent domain (e.g., namehash(\\\"agent.eth\\\")).\",\"ensRegistry_\":\"The ENS Registry address.\"}},\"registerAgentSubdomain(string,address)\":{\"details\":\"Only callable by the AgentRegistry. The subdomain is created by calling `ENS.setSubnodeOwner(baseNode, labelHash, owner)`. This contract must be the owner of `baseNode` in the ENS Registry for this to succeed. Example: If baseNode = namehash(\\\"agent.eth\\\") and subdomain = \\\"alpha\\\", this creates `alpha.agent.eth` with `owner` as its owner.\",\"params\":{\"owner\":\"The address to assign as owner of the new subdomain.\",\"subdomain\":\"The subdomain label (e.g., \\\"alpha\\\"). Must be non-empty.\"},\"returns\":{\"subnode\":\" The full ENS namehash of the newly created subdomain.\"}}},\"title\":\"ENSAgentHelper\",\"version\":1},\"userdoc\":{\"errors\":{\"EmptySubdomain()\":[{\"notice\":\"Thrown when the subdomain label is empty\"}],\"OnlyAgentRegistry()\":[{\"notice\":\"Thrown when a function restricted to the AgentRegistry is called by another address\"}],\"ZeroAddress()\":[{\"notice\":\"Thrown when the owner address is the zero address\"}]},\"events\":{\"AgentSubdomainRegistered(string,address,bytes32)\":{\"notice\":\"Emitted when a new agent subdomain is registered under the base node\"}},\"kind\":\"user\",\"methods\":{\"computeSubnode(string)\":{\"notice\":\"Computes the full ENS namehash for a subdomain under the base node.\"},\"constructor\":{\"notice\":\"Deploys the ENSAgentHelper.\"},\"i_agentRegistry()\":{\"notice\":\"The AgentRegistry contract -- sole authorized caller of registerAgentSubdomain\"},\"i_baseNode()\":{\"notice\":\"The ENS namehash of the base node (e.g., namehash(\\\"agent.eth\\\"))\"},\"i_ensRegistry()\":{\"notice\":\"The ENS Registry contract\"},\"registerAgentSubdomain(string,address)\":{\"notice\":\"Register a subdomain under the base node and assign ownership to the specified address.\"}},\"notice\":\"Helper contract for registering `<name>.agent.eth` subdomains under the $CLAWLOGIC agent namespace.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ENSAgentHelper.sol\":\"ENSAgentHelper\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@ensdomains/=lib/v4-core/node_modules/@ensdomains/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":@uma/core/=lib/protocol/packages/core/\",\":@uniswap/v4-core/=lib/v4-core/\",\":@uniswap/v4-periphery/=lib/v4-periphery/\",\":ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-gas-snapshot/=lib/v4-periphery/lib/permit2/lib/forge-gas-snapshot/src/\",\":forge-std/=lib/forge-std/src/\",\":halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/\",\":hardhat/=lib/v4-core/node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":permit2/=lib/v4-periphery/lib/permit2/\",\":solmate/=lib/v4-core/lib/solmate/\",\":v4-core/=lib/v4-core/\",\":v4-periphery/=lib/v4-periphery/\"],\"viaIR\":true},\"sources\":{\"src/ENSAgentHelper.sol\":{\"keccak256\":\"0xc321fb59dfeb339af21c72c7b5cea85c7ede4fbe951185b6cf6d6cb4d8428f30\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://eef23fb84dd26bca7ae1ac20f7a0f5eb8c9447cdc7fbe8101a7cda90acda3a84\",\"dweb:/ipfs/QmdE4m5CQVwvSNUiquQBVuE156bbCfc7eV6ZxAQGvrqEW2\"]},\"src/interfaces/IENS.sol\":{\"keccak256\":\"0x8a5b64523d7be8970af4fcfd4069eb99337eddf9acbe457467bc30b39c9b3dac\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f644a8df9a1af88332258d7d43df4f4b017e32f6a0a2cec4454e6261ac452147\",\"dweb:/ipfs/QmfMyXejpuUj5ahqNYNqA5Yz55PABa68SYnwGNQ1bHG5Sx\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.26+commit.8a97fa7a"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"contract IENS","name":"ensRegistry_","type":"address"},{"internalType":"bytes32","name":"baseNode_","type":"bytes32"},{"internalType":"address","name":"agentRegistry_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"type":"error","name":"EmptySubdomain"},{"inputs":[],"type":"error","name":"OnlyAgentRegistry"},{"inputs":[],"type":"error","name":"ZeroAddress"},{"inputs":[{"internalType":"string","name":"subdomain","type":"string","indexed":false},{"internalType":"address","name":"owner","type":"address","indexed":true},{"internalType":"bytes32","name":"subnode","type":"bytes32","indexed":true}],"type":"event","name":"AgentSubdomainRegistered","anonymous":false},{"inputs":[{"internalType":"string","name":"subdomain","type":"string"}],"stateMutability":"view","type":"function","name":"computeSubnode","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"i_agentRegistry","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"i_baseNode","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"i_ensRegistry","outputs":[{"internalType":"contract IENS","name":"","type":"address"}]},{"inputs":[{"internalType":"string","name":"subdomain","type":"string"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"registerAgentSubdomain","outputs":[{"internalType":"bytes32","name":"subnode","type":"bytes32"}]}],"devdoc":{"kind":"dev","methods":{"computeSubnode(string)":{"details":"Pure helper for off-chain tooling and verification. Does not modify state.","params":{"subdomain":"The subdomain label (e.g., \"alpha\")."},"returns":{"_0":"The full ENS namehash (e.g., namehash(\"alpha.agent.eth\"))."}},"constructor":{"details":"After deployment, the deployer must transfer ownership of `baseNode` in the ENS Registry to this contract's address so it can call `setSubnodeOwner`.","params":{"agentRegistry_":"The AgentRegistry address authorized to request subdomain creation.","baseNode_":"The namehash of the parent domain (e.g., namehash(\"agent.eth\")).","ensRegistry_":"The ENS Registry address."}},"registerAgentSubdomain(string,address)":{"details":"Only callable by the AgentRegistry. The subdomain is created by calling `ENS.setSubnodeOwner(baseNode, labelHash, owner)`. This contract must be the owner of `baseNode` in the ENS Registry for this to succeed. Example: If baseNode = namehash(\"agent.eth\") and subdomain = \"alpha\", this creates `alpha.agent.eth` with `owner` as its owner.","params":{"owner":"The address to assign as owner of the new subdomain.","subdomain":"The subdomain label (e.g., \"alpha\"). Must be non-empty."},"returns":{"subnode":" The full ENS namehash of the newly created subdomain."}}},"version":1},"userdoc":{"kind":"user","methods":{"computeSubnode(string)":{"notice":"Computes the full ENS namehash for a subdomain under the base node."},"constructor":{"notice":"Deploys the ENSAgentHelper."},"i_agentRegistry()":{"notice":"The AgentRegistry contract -- sole authorized caller of registerAgentSubdomain"},"i_baseNode()":{"notice":"The ENS namehash of the base node (e.g., namehash(\"agent.eth\"))"},"i_ensRegistry()":{"notice":"The ENS Registry contract"},"registerAgentSubdomain(string,address)":{"notice":"Register a subdomain under the base node and assign ownership to the specified address."}},"version":1}},"settings":{"remappings":["@ensdomains/=lib/v4-core/node_modules/@ensdomains/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","@uma/core/=lib/protocol/packages/core/","@uniswap/v4-core/=lib/v4-core/","@uniswap/v4-periphery/=lib/v4-periphery/","ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","forge-gas-snapshot/=lib/v4-periphery/lib/permit2/lib/forge-gas-snapshot/src/","forge-std/=lib/forge-std/src/","halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/","hardhat/=lib/v4-core/node_modules/hardhat/","openzeppelin-contracts/=lib/openzeppelin-contracts/","permit2/=lib/v4-periphery/lib/permit2/","solmate/=lib/v4-core/lib/solmate/","v4-core/=lib/v4-core/","v4-periphery/=lib/v4-periphery/"],"optimizer":{"enabled":true,"runs":200},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/ENSAgentHelper.sol":"ENSAgentHelper"},"evmVersion":"cancun","libraries":{},"viaIR":true},"sources":{"src/ENSAgentHelper.sol":{"keccak256":"0xc321fb59dfeb339af21c72c7b5cea85c7ede4fbe951185b6cf6d6cb4d8428f30","urls":["bzz-raw://eef23fb84dd26bca7ae1ac20f7a0f5eb8c9447cdc7fbe8101a7cda90acda3a84","dweb:/ipfs/QmdE4m5CQVwvSNUiquQBVuE156bbCfc7eV6ZxAQGvrqEW2"],"license":"MIT"},"src/interfaces/IENS.sol":{"keccak256":"0x8a5b64523d7be8970af4fcfd4069eb99337eddf9acbe457467bc30b39c9b3dac","urls":["bzz-raw://f644a8df9a1af88332258d7d43df4f4b017e32f6a0a2cec4454e6261ac452147","dweb:/ipfs/QmfMyXejpuUj5ahqNYNqA5Yz55PABa68SYnwGNQ1bHG5Sx"],"license":"MIT"}},"version":1},"ast":{"absolutePath":"src/ENSAgentHelper.sol","id":60213,"exportedSymbols":{"ENSAgentHelper":[60212],"IENS":[62540]},"nodeType":"SourceUnit","src":"32:6341:96","nodes":[{"id":60063,"nodeType":"PragmaDirective","src":"32:24:96","nodes":[],"literals":["solidity","^","0.8",".26"]},{"id":60065,"nodeType":"ImportDirective","src":"58:43:96","nodes":[],"absolutePath":"src/interfaces/IENS.sol","file":"./interfaces/IENS.sol","nameLocation":"-1:-1:-1","scope":60213,"sourceUnit":62541,"symbolAliases":[{"foreign":{"id":60064,"name":"IENS","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":62540,"src":"66:4:96","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"id":60212,"nodeType":"ContractDefinition","src":"1238:5134:96","nodes":[{"id":60069,"nodeType":"ErrorDefinition","src":"1504:26:96","nodes":[],"documentation":{"id":60067,"nodeType":"StructuredDocumentation","src":"1404:95:96","text":"@notice Thrown when a function restricted to the AgentRegistry is called by another address"},"errorSelector":"1014b994","name":"OnlyAgentRegistry","nameLocation":"1510:17:96","parameters":{"id":60068,"nodeType":"ParameterList","parameters":[],"src":"1527:2:96"}},{"id":60072,"nodeType":"ErrorDefinition","src":"1593:23:96","nodes":[],"documentation":{"id":60070,"nodeType":"StructuredDocumentation","src":"1536:52:96","text":"@notice Thrown when the subdomain label is empty"},"errorSelector":"4549c4ec","name":"EmptySubdomain","nameLocation":"1599:14:96","parameters":{"id":60071,"nodeType":"ParameterList","parameters":[],"src":"1613:2:96"}},{"id":60075,"nodeType":"ErrorDefinition","src":"1688:20:96","nodes":[],"documentation":{"id":60073,"nodeType":"StructuredDocumentation","src":"1622:61:96","text":"@notice Thrown when the owner address is the zero address"},"errorSelector":"d92e233d","name":"ZeroAddress","nameLocation":"1694:11:96","parameters":{"id":60074,"nodeType":"ParameterList","parameters":[],"src":"1705:2:96"}},{"id":60084,"nodeType":"EventDefinition","src":"2155:97:96","nodes":[],"anonymous":false,"documentation":{"id":60076,"nodeType":"StructuredDocumentation","src":"1843:307:96","text":"@notice Emitted when a new agent subdomain is registered under the base node\n @param subdomain The human-readable subdomain label (e.g., \"alpha\")\n @param owner The address assigned as the owner of the subdomain\n @param subnode The full ENS namehash of the registered subdomain"},"eventSelector":"9e90b787cc25043fa3d46409edffd5a567d3c2d451586f8d8f4b109dfd66a7f9","name":"AgentSubdomainRegistered","nameLocation":"2161:24:96","parameters":{"id":60083,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60078,"indexed":false,"mutability":"mutable","name":"subdomain","nameLocation":"2193:9:96","nodeType":"VariableDeclaration","scope":60084,"src":"2186:16:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":60077,"name":"string","nodeType":"ElementaryTypeName","src":"2186:6:96","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":60080,"indexed":true,"mutability":"mutable","name":"owner","nameLocation":"2220:5:96","nodeType":"VariableDeclaration","scope":60084,"src":"2204:21:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":60079,"name":"address","nodeType":"ElementaryTypeName","src":"2204:7:96","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":60082,"indexed":true,"mutability":"mutable","name":"subnode","nameLocation":"2243:7:96","nodeType":"VariableDeclaration","scope":60084,"src":"2227:23:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60081,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2227:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"2185:66:96"}},{"id":60088,"nodeType":"VariableDeclaration","src":"2433:35:96","nodes":[],"constant":false,"documentation":{"id":60085,"nodeType":"StructuredDocumentation","src":"2391:37:96","text":"@notice The ENS Registry contract"},"functionSelector":"964bee72","mutability":"immutable","name":"i_ensRegistry","nameLocation":"2455:13:96","scope":60212,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"},"typeName":{"id":60087,"nodeType":"UserDefinedTypeName","pathNode":{"id":60086,"name":"IENS","nameLocations":["2433:4:96"],"nodeType":"IdentifierPath","referencedDeclaration":62540,"src":"2433:4:96"},"referencedDeclaration":62540,"src":"2433:4:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"visibility":"public"},{"id":60091,"nodeType":"VariableDeclaration","src":"2555:35:96","nodes":[],"constant":false,"documentation":{"id":60089,"nodeType":"StructuredDocumentation","src":"2475:75:96","text":"@notice The ENS namehash of the base node (e.g., namehash(\"agent.eth\"))"},"functionSelector":"92cd341e","mutability":"immutable","name":"i_baseNode","nameLocation":"2580:10:96","scope":60212,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60090,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2555:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"public"},{"id":60094,"nodeType":"VariableDeclaration","src":"2692:40:96","nodes":[],"constant":false,"documentation":{"id":60092,"nodeType":"StructuredDocumentation","src":"2597:90:96","text":"@notice The AgentRegistry contract -- sole authorized caller of registerAgentSubdomain"},"functionSelector":"4eaeca32","mutability":"immutable","name":"i_agentRegistry","nameLocation":"2717:15:96","scope":60212,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":60093,"name":"address","nodeType":"ElementaryTypeName","src":"2692:7:96","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"public"},{"id":60118,"nodeType":"FunctionDefinition","src":"3345:193:96","nodes":[],"body":{"id":60117,"nodeType":"Block","src":"3419:119:96","nodes":[],"statements":[{"expression":{"id":60107,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":60105,"name":"i_ensRegistry","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60088,"src":"3429:13:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":60106,"name":"ensRegistry_","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60098,"src":"3445:12:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"src":"3429:28:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"id":60108,"nodeType":"ExpressionStatement","src":"3429:28:96"},{"expression":{"id":60111,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":60109,"name":"i_baseNode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60091,"src":"3467:10:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":60110,"name":"baseNode_","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60100,"src":"3480:9:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"3467:22:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":60112,"nodeType":"ExpressionStatement","src":"3467:22:96"},{"expression":{"id":60115,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":60113,"name":"i_agentRegistry","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60094,"src":"3499:15:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":60114,"name":"agentRegistry_","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60102,"src":"3517:14:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"3499:32:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":60116,"nodeType":"ExpressionStatement","src":"3499:32:96"}]},"documentation":{"id":60095,"nodeType":"StructuredDocumentation","src":"2873:467:96","text":"@notice Deploys the ENSAgentHelper.\n @dev After deployment, the deployer must transfer ownership of `baseNode` in the ENS\n Registry to this contract's address so it can call `setSubnodeOwner`.\n @param ensRegistry_ The ENS Registry address.\n @param baseNode_ The namehash of the parent domain (e.g., namehash(\"agent.eth\")).\n @param agentRegistry_ The AgentRegistry address authorized to request subdomain creation."},"implemented":true,"kind":"constructor","modifiers":[],"name":"","nameLocation":"-1:-1:-1","parameters":{"id":60103,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60098,"mutability":"mutable","name":"ensRegistry_","nameLocation":"3362:12:96","nodeType":"VariableDeclaration","scope":60118,"src":"3357:17:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"},"typeName":{"id":60097,"nodeType":"UserDefinedTypeName","pathNode":{"id":60096,"name":"IENS","nameLocations":["3357:4:96"],"nodeType":"IdentifierPath","referencedDeclaration":62540,"src":"3357:4:96"},"referencedDeclaration":62540,"src":"3357:4:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"visibility":"internal"},{"constant":false,"id":60100,"mutability":"mutable","name":"baseNode_","nameLocation":"3384:9:96","nodeType":"VariableDeclaration","scope":60118,"src":"3376:17:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60099,"name":"bytes32","nodeType":"ElementaryTypeName","src":"3376:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":60102,"mutability":"mutable","name":"agentRegistry_","nameLocation":"3403:14:96","nodeType":"VariableDeclaration","scope":60118,"src":"3395:22:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":60101,"name":"address","nodeType":"ElementaryTypeName","src":"3395:7:96","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"3356:62:96"},"returnParameters":{"id":60104,"nodeType":"ParameterList","parameters":[],"src":"3419:0:96"},"scope":60212,"stateMutability":"nonpayable","virtual":false,"visibility":"public"},{"id":60185,"nodeType":"FunctionDefinition","src":"4446:1395:96","nodes":[],"body":{"id":60184,"nodeType":"Block","src":"4555:1286:96","nodes":[],"statements":[{"condition":{"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":60131,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"expression":{"id":60128,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-15,"src":"4769:3:96","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":60129,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberLocation":"4773:6:96","memberName":"sender","nodeType":"MemberAccess","src":"4769:10:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"id":60130,"name":"i_agentRegistry","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60094,"src":"4783:15:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"4769:29:96","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":60136,"nodeType":"IfStatement","src":"4765:86:96","trueBody":{"id":60135,"nodeType":"Block","src":"4800:51:96","statements":[{"errorCall":{"arguments":[],"expression":{"argumentTypes":[],"id":60132,"name":"OnlyAgentRegistry","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60069,"src":"4821:17:96","typeDescriptions":{"typeIdentifier":"t_function_error_pure$__$returns$_t_error_$","typeString":"function () pure returns (error)"}},"id":60133,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"4821:19:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_error","typeString":"error"}},"id":60134,"nodeType":"RevertStatement","src":"4814:26:96"}]}},{"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":60143,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"expression":{"arguments":[{"id":60139,"name":"subdomain","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60121,"src":"4871:9:96","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}],"id":60138,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"4865:5:96","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes_storage_ptr_$","typeString":"type(bytes storage pointer)"},"typeName":{"id":60137,"name":"bytes","nodeType":"ElementaryTypeName","src":"4865:5:96","typeDescriptions":{}}},"id":60140,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"4865:16:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes calldata"}},"id":60141,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberLocation":"4882:6:96","memberName":"length","nodeType":"MemberAccess","src":"4865:23:96","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"hexValue":"30","id":60142,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"4892:1:96","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"4865:28:96","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":60148,"nodeType":"IfStatement","src":"4861:82:96","trueBody":{"id":60147,"nodeType":"Block","src":"4895:48:96","statements":[{"errorCall":{"arguments":[],"expression":{"argumentTypes":[],"id":60144,"name":"EmptySubdomain","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60072,"src":"4916:14:96","typeDescriptions":{"typeIdentifier":"t_function_error_pure$__$returns$_t_error_$","typeString":"function () pure returns (error)"}},"id":60145,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"4916:16:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_error","typeString":"error"}},"id":60146,"nodeType":"RevertStatement","src":"4909:23:96"}]}},{"condition":{"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":60154,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":60149,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60123,"src":"4957:5:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"arguments":[{"hexValue":"30","id":60152,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"4974:1:96","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"}],"id":60151,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"4966:7:96","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":60150,"name":"address","nodeType":"ElementaryTypeName","src":"4966:7:96","typeDescriptions":{}}},"id":60153,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"4966:10:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"4957:19:96","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":60159,"nodeType":"IfStatement","src":"4953:70:96","trueBody":{"id":60158,"nodeType":"Block","src":"4978:45:96","statements":[{"errorCall":{"arguments":[],"expression":{"argumentTypes":[],"id":60155,"name":"ZeroAddress","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60075,"src":"4999:11:96","typeDescriptions":{"typeIdentifier":"t_function_error_pure$__$returns$_t_error_$","typeString":"function () pure returns (error)"}},"id":60156,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"4999:13:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_error","typeString":"error"}},"id":60157,"nodeType":"RevertStatement","src":"4992:20:96"}]}},{"assignments":[60161],"declarations":[{"constant":false,"id":60161,"mutability":"mutable","name":"labelHash","nameLocation":"5290:9:96","nodeType":"VariableDeclaration","scope":60184,"src":"5282:17:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60160,"name":"bytes32","nodeType":"ElementaryTypeName","src":"5282:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"id":60168,"initialValue":{"arguments":[{"arguments":[{"id":60165,"name":"subdomain","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60121,"src":"5318:9:96","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}],"id":60164,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"5312:5:96","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes_storage_ptr_$","typeString":"type(bytes storage pointer)"},"typeName":{"id":60163,"name":"bytes","nodeType":"ElementaryTypeName","src":"5312:5:96","typeDescriptions":{}}},"id":60166,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"5312:16:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes calldata"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes calldata"}],"id":60162,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"5302:9:96","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":60167,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"5302:27:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"5282:47:96"},{"expression":{"id":60176,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":60169,"name":"subnode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60126,"src":"5498:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"arguments":[{"id":60172,"name":"i_baseNode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60091,"src":"5538:10:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":60173,"name":"labelHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60161,"src":"5550:9:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":60174,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60123,"src":"5561:5:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"}],"expression":{"id":60170,"name":"i_ensRegistry","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60088,"src":"5508:13:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"id":60171,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberLocation":"5522:15:96","memberName":"setSubnodeOwner","nodeType":"MemberAccess","referencedDeclaration":62531,"src":"5508:29:96","typeDescriptions":{"typeIdentifier":"t_function_external_nonpayable$_t_bytes32_$_t_bytes32_$_t_address_$returns$_t_bytes32_$","typeString":"function (bytes32,bytes32,address) external returns (bytes32)"}},"id":60175,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"5508:59:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"5498:69:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":60177,"nodeType":"ExpressionStatement","src":"5498:69:96"},{"eventCall":{"arguments":[{"id":60179,"name":"subdomain","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60121,"src":"5808:9:96","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}},{"id":60180,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60123,"src":"5819:5:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":60181,"name":"subnode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60126,"src":"5826:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":60178,"name":"AgentSubdomainRegistered","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60084,"src":"5783:24:96","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_string_memory_ptr_$_t_address_$_t_bytes32_$returns$__$","typeString":"function (string memory,address,bytes32)"}},"id":60182,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"5783:51:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":60183,"nodeType":"EmitStatement","src":"5778:56:96"}]},"documentation":{"id":60119,"nodeType":"StructuredDocumentation","src":"3685:756:96","text":"@notice Register a subdomain under the base node and assign ownership to the specified address.\n @dev Only callable by the AgentRegistry. The subdomain is created by calling\n `ENS.setSubnodeOwner(baseNode, labelHash, owner)`. This contract must be the\n owner of `baseNode` in the ENS Registry for this to succeed.\n Example: If baseNode = namehash(\"agent.eth\") and subdomain = \"alpha\",\n this creates `alpha.agent.eth` with `owner` as its owner.\n @param subdomain The subdomain label (e.g., \"alpha\"). Must be non-empty.\n @param owner The address to assign as owner of the new subdomain.\n @return subnode The full ENS namehash of the newly created subdomain."},"functionSelector":"6aae2f76","implemented":true,"kind":"function","modifiers":[],"name":"registerAgentSubdomain","nameLocation":"4455:22:96","parameters":{"id":60124,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60121,"mutability":"mutable","name":"subdomain","nameLocation":"4494:9:96","nodeType":"VariableDeclaration","scope":60185,"src":"4478:25:96","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string"},"typeName":{"id":60120,"name":"string","nodeType":"ElementaryTypeName","src":"4478:6:96","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":60123,"mutability":"mutable","name":"owner","nameLocation":"4513:5:96","nodeType":"VariableDeclaration","scope":60185,"src":"4505:13:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":60122,"name":"address","nodeType":"ElementaryTypeName","src":"4505:7:96","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"4477:42:96"},"returnParameters":{"id":60127,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60126,"mutability":"mutable","name":"subnode","nameLocation":"4546:7:96","nodeType":"VariableDeclaration","scope":60185,"src":"4538:15:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60125,"name":"bytes32","nodeType":"ElementaryTypeName","src":"4538:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"4537:17:96"},"scope":60212,"stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"id":60211,"nodeType":"FunctionDefinition","src":"6156:214:96","nodes":[],"body":{"id":60210,"nodeType":"Block","src":"6239:131:96","nodes":[],"statements":[{"assignments":[60194],"declarations":[{"constant":false,"id":60194,"mutability":"mutable","name":"labelHash","nameLocation":"6257:9:96","nodeType":"VariableDeclaration","scope":60210,"src":"6249:17:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60193,"name":"bytes32","nodeType":"ElementaryTypeName","src":"6249:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"id":60201,"initialValue":{"arguments":[{"arguments":[{"id":60198,"name":"subdomain","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60188,"src":"6285:9:96","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}],"id":60197,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"6279:5:96","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes_storage_ptr_$","typeString":"type(bytes storage pointer)"},"typeName":{"id":60196,"name":"bytes","nodeType":"ElementaryTypeName","src":"6279:5:96","typeDescriptions":{}}},"id":60199,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"6279:16:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes calldata"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes calldata"}],"id":60195,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"6269:9:96","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":60200,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"6269:27:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"6249:47:96"},{"expression":{"arguments":[{"arguments":[{"id":60205,"name":"i_baseNode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60091,"src":"6340:10:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":60206,"name":"labelHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60194,"src":"6352:9:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"expression":{"id":60203,"name":"abi","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-1,"src":"6323:3:96","typeDescriptions":{"typeIdentifier":"t_magic_abi","typeString":"abi"}},"id":60204,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberLocation":"6327:12:96","memberName":"encodePacked","nodeType":"MemberAccess","src":"6323:16:96","typeDescriptions":{"typeIdentifier":"t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$","typeString":"function () pure returns (bytes memory)"}},"id":60207,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"6323:39:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":60202,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"6313:9:96","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":60208,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"6313:50:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"functionReturnParameters":60192,"id":60209,"nodeType":"Return","src":"6306:57:96"}]},"documentation":{"id":60186,"nodeType":"StructuredDocumentation","src":"5847:304:96","text":"@notice Computes the full ENS namehash for a subdomain under the base node.\n @dev Pure helper for off-chain tooling and verification. Does not modify state.\n @param subdomain The subdomain label (e.g., \"alpha\").\n @return The full ENS namehash (e.g., namehash(\"alpha.agent.eth\"))."},"functionSelector":"15744e8d","implemented":true,"kind":"function","modifiers":[],"name":"computeSubnode","nameLocation":"6165:14:96","parameters":{"id":60189,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60188,"mutability":"mutable","name":"subdomain","nameLocation":"6196:9:96","nodeType":"VariableDeclaration","scope":60211,"src":"6180:25:96","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string"},"typeName":{"id":60187,"name":"string","nodeType":"ElementaryTypeName","src":"6180:6:96","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"6179:27:96"},"returnParameters":{"id":60192,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60191,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":60211,"src":"6230:7:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60190,"name":"bytes32","nodeType":"ElementaryTypeName","src":"6230:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"6229:9:96"},"scope":60212,"stateMutability":"view","virtual":false,"visibility":"external"}],"abstract":false,"baseContracts":[],"canonicalName":"ENSAgentHelper","contractDependencies":[],"contractKind":"contract","documentation":{"id":60066,"nodeType":"StructuredDocumentation","src":"103:1135:96","text":"@title ENSAgentHelper\n @author $CLAWLOGIC Team\n @notice Helper contract for registering `<name>.agent.eth` subdomains under the\n $CLAWLOGIC agent namespace.\n @dev This contract must own the `agent.eth` parent node in the ENS Registry (or\n whichever base node is configured). It creates subdomains on behalf of the\n AgentRegistry, so that when an agent registers as \"alpha\", the helper can\n automatically provision `alpha.agent.eth` and assign ownership to the agent's\n address.\n **Access Control:** Only the designated AgentRegistry contract may call\n `registerAgentSubdomain()`. This prevents unauthorized subdomain creation.\n **ENS Namehash Calculation:**\n - `agent.eth` = namehash(\"agent.eth\") = keccak256(abi.encodePacked(namehash(\"eth\"), keccak256(\"agent\")))\n - `alpha.agent.eth` = keccak256(abi.encodePacked(baseNode, keccak256(\"alpha\")))\n The caller is responsible for computing the correct base node off-chain or in\n the deploy script. The full subnode is computed on-chain from `baseNode + label`."},"fullyImplemented":true,"linearizedBaseContracts":[60212],"name":"ENSAgentHelper","nameLocation":"1247:14:96","scope":60213,"usedErrors":[60069,60072,60075],"usedEvents":[60084]}],"license":"MIT"},"id":96}
1
+ {"abi":[{"type":"constructor","inputs":[{"name":"ensRegistry_","type":"address","internalType":"contract IENS"},{"name":"baseNode_","type":"bytes32","internalType":"bytes32"},{"name":"agentRegistry_","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"function","name":"computeSubnode","inputs":[{"name":"subdomain","type":"string","internalType":"string"}],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"i_agentRegistry","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"i_baseNode","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"i_ensRegistry","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IENS"}],"stateMutability":"view"},{"type":"function","name":"registerAgentSubdomain","inputs":[{"name":"subdomain","type":"string","internalType":"string"},{"name":"owner","type":"address","internalType":"address"}],"outputs":[{"name":"subnode","type":"bytes32","internalType":"bytes32"}],"stateMutability":"nonpayable"},{"type":"event","name":"AgentSubdomainRegistered","inputs":[{"name":"subdomain","type":"string","indexed":false,"internalType":"string"},{"name":"owner","type":"address","indexed":true,"internalType":"address"},{"name":"subnode","type":"bytes32","indexed":true,"internalType":"bytes32"}],"anonymous":false},{"type":"error","name":"EmptySubdomain","inputs":[]},{"type":"error","name":"OnlyAgentRegistry","inputs":[]},{"type":"error","name":"ZeroAddress","inputs":[]}],"bytecode":{"object":"0x60e0346100ba57601f61055638819003918201601f19168301916001600160401b038311848410176100be578084926060946040528339810103126100ba578051906001600160a01b03821682036100ba576020810151604090910151916001600160a01b03831683036100ba5760805260a05260c05260405161048390816100d38239608051818181606501526101b3015260a05181818160af015281816101770152610363015260c05181818161011b01526102e80152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60806040526004361015610011575f80fd5b5f3560e01c806315744e8d146103175780634eaeca32146102d35780636aae2f76146100d257806392cd341e146100985763964bee7214610050575f80fd5b34610094575f366003190112610094576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5f80fd5b34610094575f3660031901126100945760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100945760403660031901126100945760043567ffffffffffffffff8111610094576101039036906004016103a3565b906024356001600160a01b03811690819003610094577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036102c45782156102b55780156102a657610160368484610407565b80516020918201206040516306ab592360e01b81527f000000000000000000000000000000000000000000000000000000000000000060048201526024810191909152604481018390529290836064815f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af192831561029b575f93610243575b50907f9e90b787cc25043fa3d46409edffd5a567d3c2d451586f8d8f4b109dfd66a7f9846040859460209782519384928a8452818b850152848401375f828201840152601f01601f19168101030190a3604051908152f35b939250906020843d602011610293575b81610260602093836103d1565b810103126100945792519192907f9e90b787cc25043fa3d46409edffd5a567d3c2d451586f8d8f4b109dfd66a7f96101eb565b3d9150610253565b6040513d5f823e3d90fd5b63d92e233d60e01b5f5260045ffd5b631152713b60e21b5f5260045ffd5b6304052e6560e21b5f5260045ffd5b34610094575f366003190112610094576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346100945760203660031901126100945760043567ffffffffffffffff81116100945761035461034d60209236906004016103a3565b3691610407565b818151910120604051828101917f000000000000000000000000000000000000000000000000000000000000000083526040820152604081526103986060826103d1565b519020604051908152f35b9181601f840112156100945782359167ffffffffffffffff8311610094576020838186019501011161009457565b90601f8019910116810190811067ffffffffffffffff8211176103f357604052565b634e487b7160e01b5f52604160045260245ffd5b92919267ffffffffffffffff82116103f35760405191610431601f8201601f1916602001846103d1565b829481845281830111610094578281602093845f96013701015256fea26469706673582212206db912caaadee1bd5e8bc483f5b7c4e6378822e48875e57435ff723e37943cd364736f6c634300081a0033","sourceMap":"1238:5134:96:-:0;;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;-1:-1:-1;;;;;1238:5134:96;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1238:5134:96;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1238:5134:96;;;;;;3429:28;;3467:22;;3499:32;;1238:5134;;;;;;;;3429:28;1238:5134;;;;;;;;;;3467:22;1238:5134;;;;;;;;;;;;;;;3499:32;1238:5134;;;;;;;;;;;;-1:-1:-1;1238:5134:96;;;;;;-1:-1:-1;1238:5134:96;;;;;-1:-1:-1;1238:5134:96","linkReferences":{}},"deployedBytecode":{"object":"0x60806040526004361015610011575f80fd5b5f3560e01c806315744e8d146103175780634eaeca32146102d35780636aae2f76146100d257806392cd341e146100985763964bee7214610050575f80fd5b34610094575f366003190112610094576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5f80fd5b34610094575f3660031901126100945760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100945760403660031901126100945760043567ffffffffffffffff8111610094576101039036906004016103a3565b906024356001600160a01b03811690819003610094577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036102c45782156102b55780156102a657610160368484610407565b80516020918201206040516306ab592360e01b81527f000000000000000000000000000000000000000000000000000000000000000060048201526024810191909152604481018390529290836064815f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af192831561029b575f93610243575b50907f9e90b787cc25043fa3d46409edffd5a567d3c2d451586f8d8f4b109dfd66a7f9846040859460209782519384928a8452818b850152848401375f828201840152601f01601f19168101030190a3604051908152f35b939250906020843d602011610293575b81610260602093836103d1565b810103126100945792519192907f9e90b787cc25043fa3d46409edffd5a567d3c2d451586f8d8f4b109dfd66a7f96101eb565b3d9150610253565b6040513d5f823e3d90fd5b63d92e233d60e01b5f5260045ffd5b631152713b60e21b5f5260045ffd5b6304052e6560e21b5f5260045ffd5b34610094575f366003190112610094576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346100945760203660031901126100945760043567ffffffffffffffff81116100945761035461034d60209236906004016103a3565b3691610407565b818151910120604051828101917f000000000000000000000000000000000000000000000000000000000000000083526040820152604081526103986060826103d1565b519020604051908152f35b9181601f840112156100945782359167ffffffffffffffff8311610094576020838186019501011161009457565b90601f8019910116810190811067ffffffffffffffff8211176103f357604052565b634e487b7160e01b5f52604160045260245ffd5b92919267ffffffffffffffff82116103f35760405191610431601f8201601f1916602001846103d1565b829481845281830111610094578281602093845f96013701015256fea26469706673582212206db912caaadee1bd5e8bc483f5b7c4e6378822e48875e57435ff723e37943cd364736f6c634300081a0033","sourceMap":"1238:5134:96:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;;;2433:35;-1:-1:-1;;;;;1238:5134:96;;;;;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;;;;2555:35;1238:5134;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;;;;;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;1238:5134:96;;;;;;;;4783:15;-1:-1:-1;;;;;1238:5134:96;4769:10;:29;4765:86;;4865:28;;4861:82;;4957:19;;4953:70;;1238:5134;;;;;:::i;:::-;;;;;;;5302:27;1238:5134;;-1:-1:-1;;;5508:59:96;;5538:10;1238:5134;5508:59;;1238:5134;;;;;;;;;;;;;;;;;5508:59;1238:5134;-1:-1:-1;5508:13:96;-1:-1:-1;;;;;1238:5134:96;5508:59;;;;;;;1238:5134;5508:59;;;1238:5134;;;5783:51;1238:5134;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;5783:51;;;;1238:5134;;;;;;5508:59;;;;;1238:5134;5508:59;;1238:5134;5508:59;;;;;;1238:5134;5508:59;;;:::i;:::-;;;1238:5134;;;;;;;;5508:59;5783:51;5508:59;;;;;-1:-1:-1;5508:59:96;;;1238:5134;;;;;;;;;4953:70;4999:13;;;1238:5134;4999:13;1238:5134;;4999:13;4861:82;4916:16;;;1238:5134;4916:16;1238:5134;;4916:16;4765:86;4821:19;;;1238:5134;4821:19;1238:5134;;4821:19;1238:5134;;;;;;-1:-1:-1;;1238:5134:96;;;;;;2692:40;-1:-1:-1;;;;;1238:5134:96;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::i;:::-;;;;;;6269:27;1238:5134;;6323:39;;;6340:10;;1238:5134;;;;;;;6323:39;;;;;;:::i;:::-;1238:5134;6313:50;;1238:5134;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;-1:-1:-1;1238:5134:96;;;;;-1:-1:-1;1238:5134:96;;;;;;;;;;;;;;;;;-1:-1:-1;;1238:5134:96;;;;;:::i;:::-;;;;;;;;;;;;;;;;;-1:-1:-1;1238:5134:96;;;;;;:::o","linkReferences":{},"immutableReferences":{"60088":[{"start":101,"length":32},{"start":435,"length":32}],"60091":[{"start":175,"length":32},{"start":375,"length":32},{"start":867,"length":32}],"60094":[{"start":283,"length":32},{"start":744,"length":32}]}},"methodIdentifiers":{"computeSubnode(string)":"15744e8d","i_agentRegistry()":"4eaeca32","i_baseNode()":"92cd341e","i_ensRegistry()":"964bee72","registerAgentSubdomain(string,address)":"6aae2f76"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.26+commit.8a97fa7a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IENS\",\"name\":\"ensRegistry_\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"baseNode_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"agentRegistry_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"EmptySubdomain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyAgentRegistry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"subdomain\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subnode\",\"type\":\"bytes32\"}],\"name\":\"AgentSubdomainRegistered\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"subdomain\",\"type\":\"string\"}],\"name\":\"computeSubnode\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_agentRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_baseNode\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_ensRegistry\",\"outputs\":[{\"internalType\":\"contract IENS\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"subdomain\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"registerAgentSubdomain\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"subnode\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"CLAWLOGIC Team\",\"details\":\"This contract must own the `agent.eth` parent node in the ENS Registry (or whichever base node is configured). It creates subdomains on behalf of the AgentRegistry, so that when an agent registers as \\\"alpha\\\", the helper can automatically provision `alpha.agent.eth` and assign ownership to the agent's address. **Access Control:** Only the designated AgentRegistry contract may call `registerAgentSubdomain()`. This prevents unauthorized subdomain creation. **ENS Namehash Calculation:** - `agent.eth` = namehash(\\\"agent.eth\\\") = keccak256(abi.encodePacked(namehash(\\\"eth\\\"), keccak256(\\\"agent\\\"))) - `alpha.agent.eth` = keccak256(abi.encodePacked(baseNode, keccak256(\\\"alpha\\\"))) The caller is responsible for computing the correct base node off-chain or in the deploy script. The full subnode is computed on-chain from `baseNode + label`.\",\"events\":{\"AgentSubdomainRegistered(string,address,bytes32)\":{\"params\":{\"owner\":\"The address assigned as the owner of the subdomain\",\"subdomain\":\"The human-readable subdomain label (e.g., \\\"alpha\\\")\",\"subnode\":\"The full ENS namehash of the registered subdomain\"}}},\"kind\":\"dev\",\"methods\":{\"computeSubnode(string)\":{\"details\":\"Pure helper for off-chain tooling and verification. Does not modify state.\",\"params\":{\"subdomain\":\"The subdomain label (e.g., \\\"alpha\\\").\"},\"returns\":{\"_0\":\"The full ENS namehash (e.g., namehash(\\\"alpha.agent.eth\\\")).\"}},\"constructor\":{\"details\":\"After deployment, the deployer must transfer ownership of `baseNode` in the ENS Registry to this contract's address so it can call `setSubnodeOwner`.\",\"params\":{\"agentRegistry_\":\"The AgentRegistry address authorized to request subdomain creation.\",\"baseNode_\":\"The namehash of the parent domain (e.g., namehash(\\\"agent.eth\\\")).\",\"ensRegistry_\":\"The ENS Registry address.\"}},\"registerAgentSubdomain(string,address)\":{\"details\":\"Only callable by the AgentRegistry. The subdomain is created by calling `ENS.setSubnodeOwner(baseNode, labelHash, owner)`. This contract must be the owner of `baseNode` in the ENS Registry for this to succeed. Example: If baseNode = namehash(\\\"agent.eth\\\") and subdomain = \\\"alpha\\\", this creates `alpha.agent.eth` with `owner` as its owner.\",\"params\":{\"owner\":\"The address to assign as owner of the new subdomain.\",\"subdomain\":\"The subdomain label (e.g., \\\"alpha\\\"). Must be non-empty.\"},\"returns\":{\"subnode\":\" The full ENS namehash of the newly created subdomain.\"}}},\"title\":\"ENSAgentHelper\",\"version\":1},\"userdoc\":{\"errors\":{\"EmptySubdomain()\":[{\"notice\":\"Thrown when the subdomain label is empty\"}],\"OnlyAgentRegistry()\":[{\"notice\":\"Thrown when a function restricted to the AgentRegistry is called by another address\"}],\"ZeroAddress()\":[{\"notice\":\"Thrown when the owner address is the zero address\"}]},\"events\":{\"AgentSubdomainRegistered(string,address,bytes32)\":{\"notice\":\"Emitted when a new agent subdomain is registered under the base node\"}},\"kind\":\"user\",\"methods\":{\"computeSubnode(string)\":{\"notice\":\"Computes the full ENS namehash for a subdomain under the base node.\"},\"constructor\":{\"notice\":\"Deploys the ENSAgentHelper.\"},\"i_agentRegistry()\":{\"notice\":\"The AgentRegistry contract -- sole authorized caller of registerAgentSubdomain\"},\"i_baseNode()\":{\"notice\":\"The ENS namehash of the base node (e.g., namehash(\\\"agent.eth\\\"))\"},\"i_ensRegistry()\":{\"notice\":\"The ENS Registry contract\"},\"registerAgentSubdomain(string,address)\":{\"notice\":\"Register a subdomain under the base node and assign ownership to the specified address.\"}},\"notice\":\"Helper contract for registering `<name>.agent.eth` subdomains under the CLAWLOGIC agent namespace.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ENSAgentHelper.sol\":\"ENSAgentHelper\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@ensdomains/=lib/v4-core/node_modules/@ensdomains/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":@uma/core/=lib/protocol/packages/core/\",\":@uniswap/v4-core/=lib/v4-core/\",\":@uniswap/v4-periphery/=lib/v4-periphery/\",\":ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-gas-snapshot/=lib/v4-periphery/lib/permit2/lib/forge-gas-snapshot/src/\",\":forge-std/=lib/forge-std/src/\",\":halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/\",\":hardhat/=lib/v4-core/node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":permit2/=lib/v4-periphery/lib/permit2/\",\":solmate/=lib/v4-core/lib/solmate/\",\":v4-core/=lib/v4-core/\",\":v4-periphery/=lib/v4-periphery/\"],\"viaIR\":true},\"sources\":{\"src/ENSAgentHelper.sol\":{\"keccak256\":\"0xc321fb59dfeb339af21c72c7b5cea85c7ede4fbe951185b6cf6d6cb4d8428f30\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://eef23fb84dd26bca7ae1ac20f7a0f5eb8c9447cdc7fbe8101a7cda90acda3a84\",\"dweb:/ipfs/QmdE4m5CQVwvSNUiquQBVuE156bbCfc7eV6ZxAQGvrqEW2\"]},\"src/interfaces/IENS.sol\":{\"keccak256\":\"0x8a5b64523d7be8970af4fcfd4069eb99337eddf9acbe457467bc30b39c9b3dac\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f644a8df9a1af88332258d7d43df4f4b017e32f6a0a2cec4454e6261ac452147\",\"dweb:/ipfs/QmfMyXejpuUj5ahqNYNqA5Yz55PABa68SYnwGNQ1bHG5Sx\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.26+commit.8a97fa7a"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"contract IENS","name":"ensRegistry_","type":"address"},{"internalType":"bytes32","name":"baseNode_","type":"bytes32"},{"internalType":"address","name":"agentRegistry_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"type":"error","name":"EmptySubdomain"},{"inputs":[],"type":"error","name":"OnlyAgentRegistry"},{"inputs":[],"type":"error","name":"ZeroAddress"},{"inputs":[{"internalType":"string","name":"subdomain","type":"string","indexed":false},{"internalType":"address","name":"owner","type":"address","indexed":true},{"internalType":"bytes32","name":"subnode","type":"bytes32","indexed":true}],"type":"event","name":"AgentSubdomainRegistered","anonymous":false},{"inputs":[{"internalType":"string","name":"subdomain","type":"string"}],"stateMutability":"view","type":"function","name":"computeSubnode","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"i_agentRegistry","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"i_baseNode","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"i_ensRegistry","outputs":[{"internalType":"contract IENS","name":"","type":"address"}]},{"inputs":[{"internalType":"string","name":"subdomain","type":"string"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"registerAgentSubdomain","outputs":[{"internalType":"bytes32","name":"subnode","type":"bytes32"}]}],"devdoc":{"kind":"dev","methods":{"computeSubnode(string)":{"details":"Pure helper for off-chain tooling and verification. Does not modify state.","params":{"subdomain":"The subdomain label (e.g., \"alpha\")."},"returns":{"_0":"The full ENS namehash (e.g., namehash(\"alpha.agent.eth\"))."}},"constructor":{"details":"After deployment, the deployer must transfer ownership of `baseNode` in the ENS Registry to this contract's address so it can call `setSubnodeOwner`.","params":{"agentRegistry_":"The AgentRegistry address authorized to request subdomain creation.","baseNode_":"The namehash of the parent domain (e.g., namehash(\"agent.eth\")).","ensRegistry_":"The ENS Registry address."}},"registerAgentSubdomain(string,address)":{"details":"Only callable by the AgentRegistry. The subdomain is created by calling `ENS.setSubnodeOwner(baseNode, labelHash, owner)`. This contract must be the owner of `baseNode` in the ENS Registry for this to succeed. Example: If baseNode = namehash(\"agent.eth\") and subdomain = \"alpha\", this creates `alpha.agent.eth` with `owner` as its owner.","params":{"owner":"The address to assign as owner of the new subdomain.","subdomain":"The subdomain label (e.g., \"alpha\"). Must be non-empty."},"returns":{"subnode":" The full ENS namehash of the newly created subdomain."}}},"version":1},"userdoc":{"kind":"user","methods":{"computeSubnode(string)":{"notice":"Computes the full ENS namehash for a subdomain under the base node."},"constructor":{"notice":"Deploys the ENSAgentHelper."},"i_agentRegistry()":{"notice":"The AgentRegistry contract -- sole authorized caller of registerAgentSubdomain"},"i_baseNode()":{"notice":"The ENS namehash of the base node (e.g., namehash(\"agent.eth\"))"},"i_ensRegistry()":{"notice":"The ENS Registry contract"},"registerAgentSubdomain(string,address)":{"notice":"Register a subdomain under the base node and assign ownership to the specified address."}},"version":1}},"settings":{"remappings":["@ensdomains/=lib/v4-core/node_modules/@ensdomains/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","@uma/core/=lib/protocol/packages/core/","@uniswap/v4-core/=lib/v4-core/","@uniswap/v4-periphery/=lib/v4-periphery/","ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","forge-gas-snapshot/=lib/v4-periphery/lib/permit2/lib/forge-gas-snapshot/src/","forge-std/=lib/forge-std/src/","halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/","hardhat/=lib/v4-core/node_modules/hardhat/","openzeppelin-contracts/=lib/openzeppelin-contracts/","permit2/=lib/v4-periphery/lib/permit2/","solmate/=lib/v4-core/lib/solmate/","v4-core/=lib/v4-core/","v4-periphery/=lib/v4-periphery/"],"optimizer":{"enabled":true,"runs":200},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/ENSAgentHelper.sol":"ENSAgentHelper"},"evmVersion":"cancun","libraries":{},"viaIR":true},"sources":{"src/ENSAgentHelper.sol":{"keccak256":"0xc321fb59dfeb339af21c72c7b5cea85c7ede4fbe951185b6cf6d6cb4d8428f30","urls":["bzz-raw://eef23fb84dd26bca7ae1ac20f7a0f5eb8c9447cdc7fbe8101a7cda90acda3a84","dweb:/ipfs/QmdE4m5CQVwvSNUiquQBVuE156bbCfc7eV6ZxAQGvrqEW2"],"license":"MIT"},"src/interfaces/IENS.sol":{"keccak256":"0x8a5b64523d7be8970af4fcfd4069eb99337eddf9acbe457467bc30b39c9b3dac","urls":["bzz-raw://f644a8df9a1af88332258d7d43df4f4b017e32f6a0a2cec4454e6261ac452147","dweb:/ipfs/QmfMyXejpuUj5ahqNYNqA5Yz55PABa68SYnwGNQ1bHG5Sx"],"license":"MIT"}},"version":1},"ast":{"absolutePath":"src/ENSAgentHelper.sol","id":60213,"exportedSymbols":{"ENSAgentHelper":[60212],"IENS":[62540]},"nodeType":"SourceUnit","src":"32:6341:96","nodes":[{"id":60063,"nodeType":"PragmaDirective","src":"32:24:96","nodes":[],"literals":["solidity","^","0.8",".26"]},{"id":60065,"nodeType":"ImportDirective","src":"58:43:96","nodes":[],"absolutePath":"src/interfaces/IENS.sol","file":"./interfaces/IENS.sol","nameLocation":"-1:-1:-1","scope":60213,"sourceUnit":62541,"symbolAliases":[{"foreign":{"id":60064,"name":"IENS","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":62540,"src":"66:4:96","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"id":60212,"nodeType":"ContractDefinition","src":"1238:5134:96","nodes":[{"id":60069,"nodeType":"ErrorDefinition","src":"1504:26:96","nodes":[],"documentation":{"id":60067,"nodeType":"StructuredDocumentation","src":"1404:95:96","text":"@notice Thrown when a function restricted to the AgentRegistry is called by another address"},"errorSelector":"1014b994","name":"OnlyAgentRegistry","nameLocation":"1510:17:96","parameters":{"id":60068,"nodeType":"ParameterList","parameters":[],"src":"1527:2:96"}},{"id":60072,"nodeType":"ErrorDefinition","src":"1593:23:96","nodes":[],"documentation":{"id":60070,"nodeType":"StructuredDocumentation","src":"1536:52:96","text":"@notice Thrown when the subdomain label is empty"},"errorSelector":"4549c4ec","name":"EmptySubdomain","nameLocation":"1599:14:96","parameters":{"id":60071,"nodeType":"ParameterList","parameters":[],"src":"1613:2:96"}},{"id":60075,"nodeType":"ErrorDefinition","src":"1688:20:96","nodes":[],"documentation":{"id":60073,"nodeType":"StructuredDocumentation","src":"1622:61:96","text":"@notice Thrown when the owner address is the zero address"},"errorSelector":"d92e233d","name":"ZeroAddress","nameLocation":"1694:11:96","parameters":{"id":60074,"nodeType":"ParameterList","parameters":[],"src":"1705:2:96"}},{"id":60084,"nodeType":"EventDefinition","src":"2155:97:96","nodes":[],"anonymous":false,"documentation":{"id":60076,"nodeType":"StructuredDocumentation","src":"1843:307:96","text":"@notice Emitted when a new agent subdomain is registered under the base node\n @param subdomain The human-readable subdomain label (e.g., \"alpha\")\n @param owner The address assigned as the owner of the subdomain\n @param subnode The full ENS namehash of the registered subdomain"},"eventSelector":"9e90b787cc25043fa3d46409edffd5a567d3c2d451586f8d8f4b109dfd66a7f9","name":"AgentSubdomainRegistered","nameLocation":"2161:24:96","parameters":{"id":60083,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60078,"indexed":false,"mutability":"mutable","name":"subdomain","nameLocation":"2193:9:96","nodeType":"VariableDeclaration","scope":60084,"src":"2186:16:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":60077,"name":"string","nodeType":"ElementaryTypeName","src":"2186:6:96","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":60080,"indexed":true,"mutability":"mutable","name":"owner","nameLocation":"2220:5:96","nodeType":"VariableDeclaration","scope":60084,"src":"2204:21:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":60079,"name":"address","nodeType":"ElementaryTypeName","src":"2204:7:96","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":60082,"indexed":true,"mutability":"mutable","name":"subnode","nameLocation":"2243:7:96","nodeType":"VariableDeclaration","scope":60084,"src":"2227:23:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60081,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2227:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"2185:66:96"}},{"id":60088,"nodeType":"VariableDeclaration","src":"2433:35:96","nodes":[],"constant":false,"documentation":{"id":60085,"nodeType":"StructuredDocumentation","src":"2391:37:96","text":"@notice The ENS Registry contract"},"functionSelector":"964bee72","mutability":"immutable","name":"i_ensRegistry","nameLocation":"2455:13:96","scope":60212,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"},"typeName":{"id":60087,"nodeType":"UserDefinedTypeName","pathNode":{"id":60086,"name":"IENS","nameLocations":["2433:4:96"],"nodeType":"IdentifierPath","referencedDeclaration":62540,"src":"2433:4:96"},"referencedDeclaration":62540,"src":"2433:4:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"visibility":"public"},{"id":60091,"nodeType":"VariableDeclaration","src":"2555:35:96","nodes":[],"constant":false,"documentation":{"id":60089,"nodeType":"StructuredDocumentation","src":"2475:75:96","text":"@notice The ENS namehash of the base node (e.g., namehash(\"agent.eth\"))"},"functionSelector":"92cd341e","mutability":"immutable","name":"i_baseNode","nameLocation":"2580:10:96","scope":60212,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60090,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2555:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"public"},{"id":60094,"nodeType":"VariableDeclaration","src":"2692:40:96","nodes":[],"constant":false,"documentation":{"id":60092,"nodeType":"StructuredDocumentation","src":"2597:90:96","text":"@notice The AgentRegistry contract -- sole authorized caller of registerAgentSubdomain"},"functionSelector":"4eaeca32","mutability":"immutable","name":"i_agentRegistry","nameLocation":"2717:15:96","scope":60212,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":60093,"name":"address","nodeType":"ElementaryTypeName","src":"2692:7:96","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"public"},{"id":60118,"nodeType":"FunctionDefinition","src":"3345:193:96","nodes":[],"body":{"id":60117,"nodeType":"Block","src":"3419:119:96","nodes":[],"statements":[{"expression":{"id":60107,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":60105,"name":"i_ensRegistry","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60088,"src":"3429:13:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":60106,"name":"ensRegistry_","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60098,"src":"3445:12:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"src":"3429:28:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"id":60108,"nodeType":"ExpressionStatement","src":"3429:28:96"},{"expression":{"id":60111,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":60109,"name":"i_baseNode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60091,"src":"3467:10:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":60110,"name":"baseNode_","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60100,"src":"3480:9:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"3467:22:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":60112,"nodeType":"ExpressionStatement","src":"3467:22:96"},{"expression":{"id":60115,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":60113,"name":"i_agentRegistry","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60094,"src":"3499:15:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":60114,"name":"agentRegistry_","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60102,"src":"3517:14:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"3499:32:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":60116,"nodeType":"ExpressionStatement","src":"3499:32:96"}]},"documentation":{"id":60095,"nodeType":"StructuredDocumentation","src":"2873:467:96","text":"@notice Deploys the ENSAgentHelper.\n @dev After deployment, the deployer must transfer ownership of `baseNode` in the ENS\n Registry to this contract's address so it can call `setSubnodeOwner`.\n @param ensRegistry_ The ENS Registry address.\n @param baseNode_ The namehash of the parent domain (e.g., namehash(\"agent.eth\")).\n @param agentRegistry_ The AgentRegistry address authorized to request subdomain creation."},"implemented":true,"kind":"constructor","modifiers":[],"name":"","nameLocation":"-1:-1:-1","parameters":{"id":60103,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60098,"mutability":"mutable","name":"ensRegistry_","nameLocation":"3362:12:96","nodeType":"VariableDeclaration","scope":60118,"src":"3357:17:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"},"typeName":{"id":60097,"nodeType":"UserDefinedTypeName","pathNode":{"id":60096,"name":"IENS","nameLocations":["3357:4:96"],"nodeType":"IdentifierPath","referencedDeclaration":62540,"src":"3357:4:96"},"referencedDeclaration":62540,"src":"3357:4:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"visibility":"internal"},{"constant":false,"id":60100,"mutability":"mutable","name":"baseNode_","nameLocation":"3384:9:96","nodeType":"VariableDeclaration","scope":60118,"src":"3376:17:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60099,"name":"bytes32","nodeType":"ElementaryTypeName","src":"3376:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":60102,"mutability":"mutable","name":"agentRegistry_","nameLocation":"3403:14:96","nodeType":"VariableDeclaration","scope":60118,"src":"3395:22:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":60101,"name":"address","nodeType":"ElementaryTypeName","src":"3395:7:96","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"3356:62:96"},"returnParameters":{"id":60104,"nodeType":"ParameterList","parameters":[],"src":"3419:0:96"},"scope":60212,"stateMutability":"nonpayable","virtual":false,"visibility":"public"},{"id":60185,"nodeType":"FunctionDefinition","src":"4446:1395:96","nodes":[],"body":{"id":60184,"nodeType":"Block","src":"4555:1286:96","nodes":[],"statements":[{"condition":{"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":60131,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"expression":{"id":60128,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-15,"src":"4769:3:96","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":60129,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberLocation":"4773:6:96","memberName":"sender","nodeType":"MemberAccess","src":"4769:10:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"id":60130,"name":"i_agentRegistry","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60094,"src":"4783:15:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"4769:29:96","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":60136,"nodeType":"IfStatement","src":"4765:86:96","trueBody":{"id":60135,"nodeType":"Block","src":"4800:51:96","statements":[{"errorCall":{"arguments":[],"expression":{"argumentTypes":[],"id":60132,"name":"OnlyAgentRegistry","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60069,"src":"4821:17:96","typeDescriptions":{"typeIdentifier":"t_function_error_pure$__$returns$_t_error_$","typeString":"function () pure returns (error)"}},"id":60133,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"4821:19:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_error","typeString":"error"}},"id":60134,"nodeType":"RevertStatement","src":"4814:26:96"}]}},{"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":60143,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"expression":{"arguments":[{"id":60139,"name":"subdomain","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60121,"src":"4871:9:96","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}],"id":60138,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"4865:5:96","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes_storage_ptr_$","typeString":"type(bytes storage pointer)"},"typeName":{"id":60137,"name":"bytes","nodeType":"ElementaryTypeName","src":"4865:5:96","typeDescriptions":{}}},"id":60140,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"4865:16:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes calldata"}},"id":60141,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberLocation":"4882:6:96","memberName":"length","nodeType":"MemberAccess","src":"4865:23:96","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"hexValue":"30","id":60142,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"4892:1:96","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"4865:28:96","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":60148,"nodeType":"IfStatement","src":"4861:82:96","trueBody":{"id":60147,"nodeType":"Block","src":"4895:48:96","statements":[{"errorCall":{"arguments":[],"expression":{"argumentTypes":[],"id":60144,"name":"EmptySubdomain","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60072,"src":"4916:14:96","typeDescriptions":{"typeIdentifier":"t_function_error_pure$__$returns$_t_error_$","typeString":"function () pure returns (error)"}},"id":60145,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"4916:16:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_error","typeString":"error"}},"id":60146,"nodeType":"RevertStatement","src":"4909:23:96"}]}},{"condition":{"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":60154,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":60149,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60123,"src":"4957:5:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"arguments":[{"hexValue":"30","id":60152,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"4974:1:96","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"}],"id":60151,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"4966:7:96","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":60150,"name":"address","nodeType":"ElementaryTypeName","src":"4966:7:96","typeDescriptions":{}}},"id":60153,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"4966:10:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"4957:19:96","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":60159,"nodeType":"IfStatement","src":"4953:70:96","trueBody":{"id":60158,"nodeType":"Block","src":"4978:45:96","statements":[{"errorCall":{"arguments":[],"expression":{"argumentTypes":[],"id":60155,"name":"ZeroAddress","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60075,"src":"4999:11:96","typeDescriptions":{"typeIdentifier":"t_function_error_pure$__$returns$_t_error_$","typeString":"function () pure returns (error)"}},"id":60156,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"4999:13:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_error","typeString":"error"}},"id":60157,"nodeType":"RevertStatement","src":"4992:20:96"}]}},{"assignments":[60161],"declarations":[{"constant":false,"id":60161,"mutability":"mutable","name":"labelHash","nameLocation":"5290:9:96","nodeType":"VariableDeclaration","scope":60184,"src":"5282:17:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60160,"name":"bytes32","nodeType":"ElementaryTypeName","src":"5282:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"id":60168,"initialValue":{"arguments":[{"arguments":[{"id":60165,"name":"subdomain","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60121,"src":"5318:9:96","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}],"id":60164,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"5312:5:96","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes_storage_ptr_$","typeString":"type(bytes storage pointer)"},"typeName":{"id":60163,"name":"bytes","nodeType":"ElementaryTypeName","src":"5312:5:96","typeDescriptions":{}}},"id":60166,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"5312:16:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes calldata"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes calldata"}],"id":60162,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"5302:9:96","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":60167,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"5302:27:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"5282:47:96"},{"expression":{"id":60176,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":60169,"name":"subnode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60126,"src":"5498:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"arguments":[{"id":60172,"name":"i_baseNode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60091,"src":"5538:10:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":60173,"name":"labelHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60161,"src":"5550:9:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":60174,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60123,"src":"5561:5:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"}],"expression":{"id":60170,"name":"i_ensRegistry","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60088,"src":"5508:13:96","typeDescriptions":{"typeIdentifier":"t_contract$_IENS_$62540","typeString":"contract IENS"}},"id":60171,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberLocation":"5522:15:96","memberName":"setSubnodeOwner","nodeType":"MemberAccess","referencedDeclaration":62531,"src":"5508:29:96","typeDescriptions":{"typeIdentifier":"t_function_external_nonpayable$_t_bytes32_$_t_bytes32_$_t_address_$returns$_t_bytes32_$","typeString":"function (bytes32,bytes32,address) external returns (bytes32)"}},"id":60175,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"5508:59:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"5498:69:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":60177,"nodeType":"ExpressionStatement","src":"5498:69:96"},{"eventCall":{"arguments":[{"id":60179,"name":"subdomain","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60121,"src":"5808:9:96","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}},{"id":60180,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60123,"src":"5819:5:96","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":60181,"name":"subnode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60126,"src":"5826:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":60178,"name":"AgentSubdomainRegistered","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60084,"src":"5783:24:96","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_string_memory_ptr_$_t_address_$_t_bytes32_$returns$__$","typeString":"function (string memory,address,bytes32)"}},"id":60182,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"5783:51:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":60183,"nodeType":"EmitStatement","src":"5778:56:96"}]},"documentation":{"id":60119,"nodeType":"StructuredDocumentation","src":"3685:756:96","text":"@notice Register a subdomain under the base node and assign ownership to the specified address.\n @dev Only callable by the AgentRegistry. The subdomain is created by calling\n `ENS.setSubnodeOwner(baseNode, labelHash, owner)`. This contract must be the\n owner of `baseNode` in the ENS Registry for this to succeed.\n Example: If baseNode = namehash(\"agent.eth\") and subdomain = \"alpha\",\n this creates `alpha.agent.eth` with `owner` as its owner.\n @param subdomain The subdomain label (e.g., \"alpha\"). Must be non-empty.\n @param owner The address to assign as owner of the new subdomain.\n @return subnode The full ENS namehash of the newly created subdomain."},"functionSelector":"6aae2f76","implemented":true,"kind":"function","modifiers":[],"name":"registerAgentSubdomain","nameLocation":"4455:22:96","parameters":{"id":60124,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60121,"mutability":"mutable","name":"subdomain","nameLocation":"4494:9:96","nodeType":"VariableDeclaration","scope":60185,"src":"4478:25:96","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string"},"typeName":{"id":60120,"name":"string","nodeType":"ElementaryTypeName","src":"4478:6:96","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":60123,"mutability":"mutable","name":"owner","nameLocation":"4513:5:96","nodeType":"VariableDeclaration","scope":60185,"src":"4505:13:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":60122,"name":"address","nodeType":"ElementaryTypeName","src":"4505:7:96","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"4477:42:96"},"returnParameters":{"id":60127,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60126,"mutability":"mutable","name":"subnode","nameLocation":"4546:7:96","nodeType":"VariableDeclaration","scope":60185,"src":"4538:15:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60125,"name":"bytes32","nodeType":"ElementaryTypeName","src":"4538:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"4537:17:96"},"scope":60212,"stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"id":60211,"nodeType":"FunctionDefinition","src":"6156:214:96","nodes":[],"body":{"id":60210,"nodeType":"Block","src":"6239:131:96","nodes":[],"statements":[{"assignments":[60194],"declarations":[{"constant":false,"id":60194,"mutability":"mutable","name":"labelHash","nameLocation":"6257:9:96","nodeType":"VariableDeclaration","scope":60210,"src":"6249:17:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60193,"name":"bytes32","nodeType":"ElementaryTypeName","src":"6249:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"id":60201,"initialValue":{"arguments":[{"arguments":[{"id":60198,"name":"subdomain","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60188,"src":"6285:9:96","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_calldata_ptr","typeString":"string calldata"}],"id":60197,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"6279:5:96","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes_storage_ptr_$","typeString":"type(bytes storage pointer)"},"typeName":{"id":60196,"name":"bytes","nodeType":"ElementaryTypeName","src":"6279:5:96","typeDescriptions":{}}},"id":60199,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"6279:16:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes calldata"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes calldata"}],"id":60195,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"6269:9:96","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":60200,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"6269:27:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"6249:47:96"},{"expression":{"arguments":[{"arguments":[{"id":60205,"name":"i_baseNode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60091,"src":"6340:10:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":60206,"name":"labelHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":60194,"src":"6352:9:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"expression":{"id":60203,"name":"abi","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-1,"src":"6323:3:96","typeDescriptions":{"typeIdentifier":"t_magic_abi","typeString":"abi"}},"id":60204,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberLocation":"6327:12:96","memberName":"encodePacked","nodeType":"MemberAccess","src":"6323:16:96","typeDescriptions":{"typeIdentifier":"t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$","typeString":"function () pure returns (bytes memory)"}},"id":60207,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"6323:39:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":60202,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"6313:9:96","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":60208,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"nameLocations":[],"names":[],"nodeType":"FunctionCall","src":"6313:50:96","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"functionReturnParameters":60192,"id":60209,"nodeType":"Return","src":"6306:57:96"}]},"documentation":{"id":60186,"nodeType":"StructuredDocumentation","src":"5847:304:96","text":"@notice Computes the full ENS namehash for a subdomain under the base node.\n @dev Pure helper for off-chain tooling and verification. Does not modify state.\n @param subdomain The subdomain label (e.g., \"alpha\").\n @return The full ENS namehash (e.g., namehash(\"alpha.agent.eth\"))."},"functionSelector":"15744e8d","implemented":true,"kind":"function","modifiers":[],"name":"computeSubnode","nameLocation":"6165:14:96","parameters":{"id":60189,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60188,"mutability":"mutable","name":"subdomain","nameLocation":"6196:9:96","nodeType":"VariableDeclaration","scope":60211,"src":"6180:25:96","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_string_calldata_ptr","typeString":"string"},"typeName":{"id":60187,"name":"string","nodeType":"ElementaryTypeName","src":"6180:6:96","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"6179:27:96"},"returnParameters":{"id":60192,"nodeType":"ParameterList","parameters":[{"constant":false,"id":60191,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":60211,"src":"6230:7:96","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":60190,"name":"bytes32","nodeType":"ElementaryTypeName","src":"6230:7:96","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"6229:9:96"},"scope":60212,"stateMutability":"view","virtual":false,"visibility":"external"}],"abstract":false,"baseContracts":[],"canonicalName":"ENSAgentHelper","contractDependencies":[],"contractKind":"contract","documentation":{"id":60066,"nodeType":"StructuredDocumentation","src":"103:1135:96","text":"@title ENSAgentHelper\n @author CLAWLOGIC Team\n @notice Helper contract for registering `<name>.agent.eth` subdomains under the\n CLAWLOGIC agent namespace.\n @dev This contract must own the `agent.eth` parent node in the ENS Registry (or\n whichever base node is configured). It creates subdomains on behalf of the\n AgentRegistry, so that when an agent registers as \"alpha\", the helper can\n automatically provision `alpha.agent.eth` and assign ownership to the agent's\n address.\n **Access Control:** Only the designated AgentRegistry contract may call\n `registerAgentSubdomain()`. This prevents unauthorized subdomain creation.\n **ENS Namehash Calculation:**\n - `agent.eth` = namehash(\"agent.eth\") = keccak256(abi.encodePacked(namehash(\"eth\"), keccak256(\"agent\")))\n - `alpha.agent.eth` = keccak256(abi.encodePacked(baseNode, keccak256(\"alpha\")))\n The caller is responsible for computing the correct base node off-chain or in\n the deploy script. The full subnode is computed on-chain from `baseNode + label`."},"fullyImplemented":true,"linearizedBaseContracts":[60212],"name":"ENSAgentHelper","nameLocation":"1247:14:96","scope":60213,"usedErrors":[60069,60072,60075],"usedEvents":[60084]}],"license":"MIT"},"id":96}