File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ import {CAIP2} from "./CAIP2.sol";
13
13
* account_id: chain_id + ":" + account_address
14
14
* chain_id: [-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32} (See {CAIP2})
15
15
* account_address: [-.%a-zA-Z0-9]{1,128}
16
+ *
17
+ * WARNING: According to [CAIP-10's canonicalization section](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-10.md#canonicalization),
18
+ * the implementation remains at the developer's discretion. Please note that case variations may introduce ambiguity.
19
+ * For example, when building hashes to identify accounts or data associated to them, multiple representations of the
20
+ * same account would derive to different hashes. For EVM chains, we recommend using checksummed addresses for the
21
+ * "account_address" part. They can be generated onchain using {Strings-toChecksumHexString}.
16
22
*/
17
23
library CAIP10 {
18
24
using Strings for address ;
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ import {Strings} from "./Strings.sol";
12
12
* chain_id: namespace + ":" + reference
13
13
* namespace: [-a-z0-9]{3,8}
14
14
* reference: [-_a-zA-Z0-9]{1,32}
15
+ *
16
+ * WARNING: In some cases, multiple CAIP-2 identifiers may all be valid representation of a single chain.
17
+ * For EVM chains, it is recommended to use `eip155:xxx` as the canonical representation (where `xxx` is
18
+ * the EIP-155 chain id). Consider the possible ambiguity when processing CAIP-2 identifiers or when using them
19
+ * in the context of hashes.
15
20
*/
16
21
library CAIP2 {
17
22
using Strings for uint256 ;
You can’t perform that action at this time.
0 commit comments