From bef7117a039dbb414c3eb92b32d44611f5554bd6 Mon Sep 17 00:00:00 2001 From: mj Date: Wed, 4 Sep 2024 16:40:17 -0400 Subject: [PATCH 1/3] precompile additions --- packages/evm/README.md | 3 +++ packages/evm/src/precompiles/address.ts | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/evm/README.md b/packages/evm/README.md index 08b8d421..9f105a90 100644 --- a/packages/evm/README.md +++ b/packages/evm/README.md @@ -111,6 +111,9 @@ The Address precompile contract enables the retrieval of associated EVM addresse |----------------------------------------------------------------------------------------|-------------------|------------------------|------------------------------------------------------------------| | [`getEvmAddr`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#getEvmAddr) | `addr: ` `string` | `{ response: string }` | Retrieves the associated EVM address for a given Cosmos address. | | [`getSeiAddr`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#getSeiAddr) | `addr: ` `string` | `{ response: string }` | Retrieves the associated Cosmos address for a given EVM address. | +| [`associate`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#associate) | `v: ` `string`, `r: ` `string`, `s: ` `string`, `customMessage: ` `string` | `{ response: string }` | Associates an EVM address with it's corresponding Cosmos address on chain using a signature. | +| [`associatePubKey`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#associatePubKey) | `pubKeyHex: ` `string` | `{ response: string }` | Associates an EVM address with it's corresponding Cosmos address on chain using the Hex-Encoded compressed pubkey (excluding the '0x'). | + #### Precompile Address 0x0000000000000000000000000000000000001004 diff --git a/packages/evm/src/precompiles/address.ts b/packages/evm/src/precompiles/address.ts index d9274244..9b78bf6b 100644 --- a/packages/evm/src/precompiles/address.ts +++ b/packages/evm/src/precompiles/address.ts @@ -23,5 +23,19 @@ export const ADDRESS_PRECOMPILE_ABI = [ outputs: [{ internalType: 'string', name: 'response', type: 'string' }], stateMutability: 'view', type: 'function' - } + }, + { + inputs: [{ internalType: 'string', name: 'v', type: 'string' }, { internalType: 'string', name: 'r', type: 'string' }, { internalType: 'string', name: 's', type: 'string' }, { internalType: 'string', name: 'customMessage', type: 'string' }], + name: 'associate', + outputs: [{ internalType: 'string', name: 'seiAddr', type: 'string' }, { internalType: 'address', name: 'evmAddr', type: 'address' }], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [{ internalType: 'string', name: 'pubKeyHex', type: 'string' }], + name: 'associatePubKey', + outputs: [{ internalType: 'string', name: 'seiAddr', type: 'string' }, { internalType: 'address', name: 'evmAddr', type: 'address' }], + stateMutability: 'nonpayable', + type: 'function' + }, ] as const; From f1caa9beea147dd378d6920baa6043709da2a667 Mon Sep 17 00:00:00 2001 From: mj Date: Wed, 4 Sep 2024 16:46:30 -0400 Subject: [PATCH 2/3] changeset --- .changeset/dry-parents-provide.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/dry-parents-provide.md diff --git a/.changeset/dry-parents-provide.md b/.changeset/dry-parents-provide.md new file mode 100644 index 00000000..d5f53dd4 --- /dev/null +++ b/.changeset/dry-parents-provide.md @@ -0,0 +1,5 @@ +--- +"@sei-js/evm": patch +--- + +Update addr precompiles From 1b1e5ecbf34fc7a1ca49330c9d8884ad172ad6d3 Mon Sep 17 00:00:00 2001 From: mj Date: Mon, 16 Sep 2024 17:34:20 -0400 Subject: [PATCH 3/3] update readme comment --- packages/evm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/evm/README.md b/packages/evm/README.md index 9f105a90..e9130a26 100644 --- a/packages/evm/README.md +++ b/packages/evm/README.md @@ -111,7 +111,7 @@ The Address precompile contract enables the retrieval of associated EVM addresse |----------------------------------------------------------------------------------------|-------------------|------------------------|------------------------------------------------------------------| | [`getEvmAddr`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#getEvmAddr) | `addr: ` `string` | `{ response: string }` | Retrieves the associated EVM address for a given Cosmos address. | | [`getSeiAddr`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#getSeiAddr) | `addr: ` `string` | `{ response: string }` | Retrieves the associated Cosmos address for a given EVM address. | -| [`associate`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#associate) | `v: ` `string`, `r: ` `string`, `s: ` `string`, `customMessage: ` `string` | `{ response: string }` | Associates an EVM address with it's corresponding Cosmos address on chain using a signature. | +| [`associate`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#associate) | `v: ` `string`, `r: ` `string`, `s: ` `string`, `customMessage: ` `string` | `{ response: string }` | Associates an EVM address with it's corresponding Sei Native address on chain using a signature. | | [`associatePubKey`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#associatePubKey) | `pubKeyHex: ` `string` | `{ response: string }` | Associates an EVM address with it's corresponding Cosmos address on chain using the Hex-Encoded compressed pubkey (excluding the '0x'). |