Skip to content

Commit f5b638a

Browse files
committed
Feat: Add ERC8004 contracts
Signed-off-by: Ojuswi Rastogi <ojuswimail@gmail.com>
1 parent 5a4b83a commit f5b638a

File tree

16 files changed

+522
-2
lines changed

16 files changed

+522
-2
lines changed

autonomy/chain/base.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
CONTRACTS_DIR_FRAMEWORK,
3232
CONTRACTS_DIR_LOCAL,
3333
ERC20_CONTRACT,
34+
ERC8004_IDENTITY_REGISTRY_BRIDGER_CONTRACT,
35+
ERC8004_IDENTITY_REGISTRY_CONTRACT,
3436
GNOSIS_SAFE_CONTRACT,
3537
GNOSIS_SAFE_PROXY_FACTORY_CONTRACT,
3638
MULTISEND_CONTRACT,
@@ -40,6 +42,7 @@
4042
SERVICE_MANAGER_CONTRACT,
4143
SERVICE_REGISTRY_CONTRACT,
4244
SERVICE_REGISTRY_TOKEN_UTILITY_CONTRACT,
45+
SIGN_MESSAGE_LIB_CONTRACT,
4346
)
4447

4548

@@ -87,6 +90,9 @@ class RegistryContracts: # pylint: disable=too-many-instance-attributes
8790
_recovery_module: Optional[Contract] = None
8891
_poly_safe_creator_with_recovery_module: Optional[Contract] = None
8992
_multisend: Optional[Contract] = None
93+
_sign_message_lib: Optional[Contract] = None
94+
_erc8004_identity_registry: Optional[Contract] = None
95+
_erc8004_identity_registry_bridger: Optional[Contract] = None
9096

9197
@staticmethod
9298
def get_contract(public_id: PublicId, cache: bool = True) -> Contract:
@@ -260,5 +266,41 @@ def multisend(
260266

261267
return self._multisend
262268

269+
@property
270+
def sign_message_lib(
271+
self,
272+
) -> Contract:
273+
"""Returns an instance of the sign message lib contract."""
274+
if self._sign_message_lib is None:
275+
self._sign_message_lib = self.get_contract(
276+
public_id=SIGN_MESSAGE_LIB_CONTRACT,
277+
)
278+
279+
return self._sign_message_lib
280+
281+
@property
282+
def erc8004_identity_registry(
283+
self,
284+
) -> Contract:
285+
"""Returns an instance of the ERC8004 identity registry contract."""
286+
if self._erc8004_identity_registry is None:
287+
self._erc8004_identity_registry = self.get_contract(
288+
public_id=ERC8004_IDENTITY_REGISTRY_CONTRACT,
289+
)
290+
291+
return self._erc8004_identity_registry
292+
293+
@property
294+
def erc8004_identity_registry_bridger(
295+
self,
296+
) -> Contract:
297+
"""Returns an instance of the ERC8004 identity registry bridger contract."""
298+
if self._erc8004_identity_registry_bridger is None:
299+
self._erc8004_identity_registry_bridger = self.get_contract(
300+
public_id=ERC8004_IDENTITY_REGISTRY_BRIDGER_CONTRACT,
301+
)
302+
303+
return self._erc8004_identity_registry_bridger
304+
263305

264306
registry_contracts = RegistryContracts()

autonomy/chain/config.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,32 @@ class ContractConfigs: # pylint: disable=too-few-public-methods
495495
contracts={},
496496
)
497497

498+
sign_message_lib = ContractConfig(
499+
name="sign_message_lib",
500+
contracts={
501+
ChainType(chain_name): cast(str, container.get("sign_message_lib"))
502+
for chain_name, container in CHAIN_PROFILES.items()
503+
},
504+
)
505+
506+
erc8004_identity_registry = ContractConfig(
507+
name="erc8004_identity_registry",
508+
contracts={
509+
ChainType(chain_name): cast(str, container.get("erc8004_identity_registry"))
510+
for chain_name, container in CHAIN_PROFILES.items()
511+
},
512+
)
513+
514+
erc8004_identity_registry_bridger = ContractConfig(
515+
name="erc8004_identity_registry_bridger",
516+
contracts={
517+
ChainType(chain_name): cast(
518+
str, container.get("erc8004_identity_registry_bridger")
519+
)
520+
for chain_name, container in CHAIN_PROFILES.items()
521+
},
522+
)
523+
498524
@classmethod
499525
def get(cls, name: str) -> ContractConfig:
500526
"""Return chain config for given chain type."""

autonomy/chain/constants.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
) # use from an editable/local installation
3737

3838
ERC20_TOKEN_ADDRESS_LOCAL = "0x1291Be112d480055DaFd8a610b7d1e203891C274" # nosec
39-
DEFAULT_MULTISEND = "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D"
39+
DEFAULT_MULTISEND = "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761"
4040
CHAIN_PROFILES = {
4141
"local": {
4242
"component_registry": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
@@ -65,6 +65,9 @@
6565
"staking_verifier": "0x4503b79d468e81Ad2d4bd6Db991810da269bA777",
6666
"staking_factory": "0xEBdde456EA288b49f7D5975E7659bA1Ccf607efc",
6767
"complementary_service_metadata": "0x0561cE39A1ab785B02DE0D9903125702559993A1",
68+
"sign_message_lib": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
69+
"erc8004_identity_registry": "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
70+
"erc8004_identity_registry_bridger": "0x461A76074596F080dfba414532Ab51280611B8e6",
6871
},
6972
"polygon": {
7073
"service_registry": "0xE3607b00E75f6405248323A9417ff6b39B244b50",
@@ -78,6 +81,9 @@
7881
"staking_token": "0x4aba1Cf7a39a51D75cBa789f5f21cf4882162519",
7982
"staking_verifier": "0x8Bc0a5c5B1612A16983B01ecd7ae130E728390CB",
8083
"staking_factory": "0x46C0D07F55d4F9B5Eed2Fc9680B5953e5fd7b461",
84+
"sign_message_lib": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
85+
"erc8004_identity_registry": "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
86+
"erc8004_identity_registry_bridger": "0x6F121552765424f0B2331B541C0938480cA314Db",
8187
},
8288
"gnosis": {
8389
"service_registry": "0x9338b5153AE39BB89f50468E608eD9d764B755fD",
@@ -91,6 +97,9 @@
9197
"staking_verifier": "0x1D59DadE4FAeA7771eC7221420012d413175404C",
9298
"staking_factory": "0xb0228CA253A88Bc8eb4ca70BCAC8f87b381f4700",
9399
"complementary_service_metadata": "0x0598081D48FB80B0A7E52FAD2905AE9beCd6fC69",
100+
"sign_message_lib": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
101+
"erc8004_identity_registry": "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
102+
"erc8004_identity_registry_bridger": "0x6e8F740F23f07cE129Daa59786926fecA8C2D2F3",
94103
},
95104
"arbitrum_one": {
96105
"service_registry": "0xE3607b00E75f6405248323A9417ff6b39B244b50",
@@ -103,6 +112,7 @@
103112
"staking_token": "0x04b0007b2aFb398015B76e5f22993a1fddF83644",
104113
"staking_verifier": "0x7Fd1F4b764fA41d19fe3f63C85d12bf64d2bbf68",
105114
"staking_factory": "0xEB5638eefE289691EcE01943f768EDBF96258a80",
115+
"sign_message_lib": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
106116
},
107117
"optimism": {
108118
"service_registry": "0x3d77596beb0f130a4415df3D2D8232B3d3D31e44",
@@ -115,6 +125,7 @@
115125
"staking_token": "0x63C2c53c09dE534Dd3bc0b7771bf976070936bAC",
116126
"staking_verifier": "0x526E064cB694E8f5B7DB299158e17F33055B3943",
117127
"staking_factory": "0xa45E64d13A30a51b91ae0eb182e88a40e9b18eD8",
128+
"sign_message_lib": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
118129
},
119130
"base": {
120131
"service_registry": "0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE",
@@ -128,6 +139,9 @@
128139
"staking_verifier": "0x10c5525F77F13b28f42c5626240c001c2D57CAd4",
129140
"staking_factory": "0x1cEe30D08943EB58EFF84DD1AB44a6ee6FEff63a",
130141
"complementary_service_metadata": "0x28C1edC7CEd549F7f80B732fDC19f0370160707d",
142+
"sign_message_lib": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
143+
"erc8004_identity_registry": "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
144+
"erc8004_identity_registry_bridger": "0x67722c823010ceb4bed5325fe109196c0f67d053",
131145
},
132146
"celo": {
133147
"service_registry": "0xE3607b00E75f6405248323A9417ff6b39B244b50",
@@ -140,6 +154,7 @@
140154
"staking_token": "0xe1E1B286EbE95b39F785d8069f2248ae9C41b7a9",
141155
"staking_verifier": "0xc40C79C275F3fA1F3f4c723755C81ED2D53A8D81",
142156
"staking_factory": "0x1c2cD884127b080F940b7546c1e9aaf525b1FA55",
157+
"sign_message_lib": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
143158
},
144159
"mode": {
145160
"service_registry": "0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE",
@@ -153,6 +168,7 @@
153168
"staking_native_token": "0x88DE734655184a09B70700aE4F72364d1ad23728",
154169
"staking_verifier": "0x87c511c8aE3fAF0063b3F3CF9C6ab96c4AA5C60c",
155170
"staking_factory": "0x75D529FAe220bC8db714F0202193726b46881B76",
171+
"sign_message_lib": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
156172
},
157173
"custom_chain": {
158174
"component_registry": cast(
@@ -190,6 +206,16 @@
190206
"CUSTOM_MULTISEND_ADDRESS", "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D"
191207
),
192208
),
209+
"sign_message_lib": cast(
210+
str, os.environ.get("CUSTOM_SIGN_MESSAGE_LIB_ADDRESS")
211+
),
212+
"erc8004_identity_registry": cast(
213+
str, os.environ.get("CUSTOM_ERC8004_IDENTITY_REGISTRY_ADDRESS")
214+
),
215+
"erc8004_identity_registry_bridger": cast(
216+
str,
217+
os.environ.get("CUSTOM_ERC8004_IDENTITY_REGISTRY_BRIDGER_ADDRESS"),
218+
),
193219
},
194220
}
195221

@@ -261,6 +287,13 @@
261287
)
262288
MULTISEND_CONTRACT = PublicId.from_str("valory/multisend")
263289
ERC20_CONTRACT = PublicId.from_str("valory/erc20")
290+
SIGN_MESSAGE_LIB_CONTRACT = PublicId.from_str("valory/sign_message_lib")
291+
ERC8004_IDENTITY_REGISTRY_CONTRACT = PublicId.from_str(
292+
"valory/erc8004_identity_registry"
293+
)
294+
ERC8004_IDENTITY_REGISTRY_BRIDGER_CONTRACT = PublicId.from_str(
295+
"valory/erc8004_identity_registry_bridger"
296+
)
264297

265298
SERVICE_MANAGER_TOKEN_COMPATIBLE_CHAINS = (
266299
1,

docs/api/chain/base.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,36 @@ def multisend() -> Contract
181181

182182
Returns an instance of the multisend contract.
183183

184+
<a id="autonomy.chain.base.RegistryContracts.sign_message_lib"></a>
185+
186+
#### sign`_`message`_`lib
187+
188+
```python
189+
@property
190+
def sign_message_lib() -> Contract
191+
```
192+
193+
Returns an instance of the sign message lib contract.
194+
195+
<a id="autonomy.chain.base.RegistryContracts.erc8004_identity_registry"></a>
196+
197+
#### erc8004`_`identity`_`registry
198+
199+
```python
200+
@property
201+
def erc8004_identity_registry() -> Contract
202+
```
203+
204+
Returns an instance of the ERC8004 identity registry contract.
205+
206+
<a id="autonomy.chain.base.RegistryContracts.erc8004_identity_registry_bridger"></a>
207+
208+
#### erc8004`_`identity`_`registry`_`bridger
209+
210+
```python
211+
@property
212+
def erc8004_identity_registry_bridger() -> Contract
213+
```
214+
215+
Returns an instance of the ERC8004 identity registry bridger contract.
216+

docs/package_list.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
| contract/valory/squads_multisig/0.1.0 | `bafybeigjamatvbf3ofouvbth2ldvaur7m5pxklzqiwfnjneenvdvc3c2mq` | The scaffold contract scaffolds a contract to be implemented by the developer. |
1818
| contract/valory/multicall2/0.1.0 | `bafybeidvcbchqj7spljepv6awxgkdpnvrohic27z2rb56ko7hnazojoxkq` | The MakerDAO multicall2 contract. |
1919
| contract/valory/poly_safe_creator_with_recovery_module/0.1.0 | `bafybeihpqqllm57nyd74r4yvadv2emjlo5xjm35alyijljiy7qny2djgay` | PolySafe creator with recovery module |
20+
| contract/valory/sign_message_lib/0.1.0 | `bafybeiah5ej54zxrf2lidqe5sgnjgdtfnsbvfwxu7b5qbtubsecmqtvbru` | SignMessageLib contract |
21+
| contract/valory/erc8004_identity_registry/0.1.0 | `bafybeigmfcrdp2urpl7zqihsl7rmjjx7ma5hla7qo3nfv6klbewetyk4uq` | ERC8004 Identity Registry contract |
22+
| contract/valory/erc8004_identity_registry_bridger/0.1.0 | `bafybeih3cm2za6zk2462w7va7epssobgahahjinvgm5xa42sksnjbhsuqu` | ERC8004 Identity Registry Bridger contract |
2023
| connection/valory/abci/0.1.0 | `bafybeial4fha7gc5abbdiw7wiyczpwwowwsu2puze7zefrah5qqra5foku` | connection to wrap communication with an ABCI server. |
2124
| connection/valory/ipfs/0.1.0 | `bafybeif2252xypx25p42fva4y3wi4loinxi6pfwf4wkwgcbdbfiu3gmjqu` | A connection responsible for uploading and downloading files from IPFS. |
2225
| skill/valory/test_ipfs_abci/0.1.0 | `bafybeid6gsyeoydzdp4gytdvwuhwvho2zvykxfmgr6relg5hyfun2zbn2m` | IPFS e2e testing application. |

packages/packages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"contract/valory/squads_multisig/0.1.0": "bafybeigjamatvbf3ofouvbth2ldvaur7m5pxklzqiwfnjneenvdvc3c2mq",
1818
"contract/valory/multicall2/0.1.0": "bafybeidvcbchqj7spljepv6awxgkdpnvrohic27z2rb56ko7hnazojoxkq",
1919
"contract/valory/poly_safe_creator_with_recovery_module/0.1.0": "bafybeihpqqllm57nyd74r4yvadv2emjlo5xjm35alyijljiy7qny2djgay",
20+
"contract/valory/sign_message_lib/0.1.0": "bafybeiah5ej54zxrf2lidqe5sgnjgdtfnsbvfwxu7b5qbtubsecmqtvbru",
21+
"contract/valory/erc8004_identity_registry/0.1.0": "bafybeigmfcrdp2urpl7zqihsl7rmjjx7ma5hla7qo3nfv6klbewetyk4uq",
22+
"contract/valory/erc8004_identity_registry_bridger/0.1.0": "bafybeih3cm2za6zk2462w7va7epssobgahahjinvgm5xa42sksnjbhsuqu",
2023
"connection/valory/abci/0.1.0": "bafybeial4fha7gc5abbdiw7wiyczpwwowwsu2puze7zefrah5qqra5foku",
2124
"connection/valory/ipfs/0.1.0": "bafybeif2252xypx25p42fva4y3wi4loinxi6pfwf4wkwgcbdbfiu3gmjqu",
2225
"skill/valory/test_ipfs_abci/0.1.0": "bafybeid6gsyeoydzdp4gytdvwuhwvho2zvykxfmgr6relg5hyfun2zbn2m",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# ------------------------------------------------------------------------------
3+
#
4+
# Copyright 2026 Valory AG
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# ------------------------------------------------------------------------------
19+
20+
"""This module contains the erc8004_identity_registry contract."""

0 commit comments

Comments
 (0)