Skip to content

Commit

Permalink
Update Testnet MPC Contract Address (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith authored May 8, 2024
1 parent a845774 commit 46eeea2
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NEAR_ACCOUNT_ID=
NEAR_ACCOUNT_PRIVATE_KEY=
NEAR_MULTICHAIN_CONTRACT=multichain-testnet-2.testnet
NEAR_MULTICHAIN_CONTRACT=v2.multichain-mpc.testnet
23 changes: 23 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: End to End Tests

on:
push:
branches: [main]

jobs:
types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: E2E Test
run: yarn && yarn test e2e
env:
NEAR_MULTICHAIN_CONTRACT: v2.multichain-mpc.testnet
NEAR_ACCOUNT_ID: ${{secrets.NEAR_ACCOUNT_ID}}
NEAR_ACCOUNT_PRIVATE_KEY: ${{secrets.NEAR_PK}}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,3 @@ jobs:
run: |
yarn lint
yarn test unit
# These are only relevant for e2e tests
# env:
# NEAR_MULTICHAIN_CONTRACT: multichain-testnet-2.testnet
# NEAR_MULTICHAIN_CONTRACT: v5.multichain-mpc-dev.testnet
# NEAR_ACCOUNT_ID: ${{secrets.NEAR_ACCOUNT_ID}}
# NEAR_ACCOUNT_PRIVATE_KEY: ${{secrets.NEAR_PK}}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ await adapter.signAndSendTransaction({
receiver: "0xdeADBeeF0000000000000000000000000b00B1e5",
amount: 0.00000001,
chainId: 11_155_111,
// Optional Set nearGas (default is 200 TGAS - which still sometimes doesn't work!)
// Optional Set nearGas (default is 300 TGAS - which still sometimes doesn't work!)
});
```

Expand Down
3 changes: 2 additions & 1 deletion examples/send-eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ dotenv.config();
const run = async (): Promise<void> => {
const evm = await setupNearEthAdapter();
await evm.signAndSendTransaction({
to: "0xdeADBeeF0000000000000000000000000b00B1e5",
// Sending to self.
to: evm.address,
// THIS IS ONE WEI!
value: 1n,
chainId: SEPOLIA_CHAIN_ID,
Expand Down
4 changes: 2 additions & 2 deletions src/chains/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class NearEthAdapter {
* acquires signature from Near MPC Contract and submits transaction to public mempool.
*
* @param {BaseTx} txData - Minimal transaction data to be signed by Near MPC and executed on EVM.
* @param {bigint} nearGas - manually specified gas to be sent with signature request (default 200 TGAS).
* @param {bigint} nearGas - manually specified gas to be sent with signature request (default 300 TGAS).
* Note that the signature request is a recursive function.
*/
async signAndSendTransaction(
Expand All @@ -94,7 +94,7 @@ export class NearEthAdapter {
* acquires signature from Near MPC Contract and submits transaction to public mempool.
*
* @param {BaseTx} txData - Minimal transaction data to be signed by Near MPC and executed on EVM.
* @param {bigint} nearGas - manually specified gas to be sent with signature request (default 200 TGAS).
* @param {bigint} nearGas - manually specified gas to be sent with signature request (default 300 TGAS).
* Note that the signature request is a recursive function.
*/
async getSignatureRequestPayload(
Expand Down
4 changes: 2 additions & 2 deletions src/mpcContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ function gasOrDefault(gas?: bigint): string {
if (gas !== undefined) {
return gas.toString();
}
// Default of 200 TGAS
return (TGAS * 200n).toString();
// Default of 300 TGAS
return (TGAS * 300n).toString();
}
19 changes: 6 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -984,13 +984,6 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==

"@types/keccak@^3.0.4":
version "3.0.4"
resolved "https://registry.yarnpkg.com/@types/keccak/-/keccak-3.0.4.tgz#bd4052c5484c55adfd4edb321dce841d8ed4119e"
integrity sha512-hdnkmbie7tE0yXnQQvlIOqCyjEsoXDVEZ3ACqO+F305XgUOW4Z9ElWdogCXXRAW/khnZ7GxM0t/BGB5bORKt/g==
dependencies:
"@types/node" "*"

"@types/node@*", "@types/node@^20.11.30":
version "20.12.11"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.11.tgz#c4ef00d3507000d17690643278a60dc55a9dc9be"
Expand Down Expand Up @@ -1631,9 +1624,9 @@ dotenv@^16.4.5:
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==

electron-to-chromium@^1.4.668:
version "1.4.758"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.758.tgz#f39e530cae2ca4329a0f0e1840629d8d1da73156"
integrity sha512-/o9x6TCdrYZBMdGeTifAP3wlF/gVT+TtWJe3BSmtNh92Mw81U9hrYwW9OAGUh+sEOX/yz5e34sksqRruZbjYrw==
version "1.4.759"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.759.tgz#ed7f4d9eed25124708ab0f4422e66b16534648d3"
integrity sha512-qZJc+zsuI+/5UjOSFnpkJBwwLMH1AZgyKqJ7LUNnRsB7v/cDjMu9DvXgp9kH6PTTZxjnPXGp2Uhurw+2Ll4Hjg==

elliptic@^6.5.5:
version "6.5.5"
Expand Down Expand Up @@ -2915,9 +2908,9 @@ onetime@^5.1.2:
mimic-fn "^2.1.0"

opensea-js@^7.0.9:
version "7.1.7"
resolved "https://registry.yarnpkg.com/opensea-js/-/opensea-js-7.1.7.tgz#23988f13dcb277d4ae6b851ae97377a99e091f31"
integrity sha512-uyfgfx9jAPTshy983yex6j63r1aTz54Bu0Bfu1Sf+JXVPRqcyNuQWPEH7zf/nJx4noEUnQQsZDE1mg8Bdn04+g==
version "7.1.8"
resolved "https://registry.yarnpkg.com/opensea-js/-/opensea-js-7.1.8.tgz#d43434d47a1bb5c3e643ece80cc9dc8f2118a152"
integrity sha512-DBlfMuBoNfMvVO7siQQE72wCdgQqG0qgJWi9H8CNkaBrU2IMl2kAjZE//cbqZyWEb9Kie/CEpbT6ICy0wjh4dg==
dependencies:
"@opensea/seaport-js" "^4.0.0"
ethers "^6.9.0"
Expand Down

0 comments on commit 46eeea2

Please sign in to comment.