-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
submit signTypedData to chain successful
- Loading branch information
Eason Smith
committed
Nov 21, 2024
1 parent
952da17
commit 3cd1dc6
Showing
3 changed files
with
174 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
1. use ganache js to run a ethereum node locally | ||
``` | ||
npx ganache \ | ||
--account="0x0000000000000000000000000000000000000000000000000000000000000001,1000000000000000000" \ | ||
--account="0x0000000000000000000000000000000000000000000000000000000000000002,1000000000000000000" | ||
``` | ||
2. Add an account to MetaMask using the private keys above | ||
3. Add the local ethereum node as a network in MetaMask | ||
``` | ||
RPC URL: http://127.0.0.1:8545 | ||
Chain ID: 1337 | ||
Currency: ETH | ||
``` | ||
### Add BNB Chain Testnet to MetaMask | ||
| Key | Value | | ||
|-------|-------| | ||
| RPC URL | https://data-seed-prebsc-1-s1.binance.org:8545 | | ||
| Chain ID | 97 | | ||
| Currency symbol | tBNB | | ||
| Block explorer URL | https://testnet.bscscan.com | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
[ | ||
{ | ||
"inputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "constructor" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "ECDSAInvalidSignature", | ||
"type": "error" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "length", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "ECDSAInvalidSignatureLength", | ||
"type": "error" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "s", | ||
"type": "bytes32" | ||
} | ||
], | ||
"name": "ECDSAInvalidSignatureS", | ||
"type": "error" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "InvalidShortString", | ||
"type": "error" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "string", | ||
"name": "str", | ||
"type": "string" | ||
} | ||
], | ||
"name": "StringTooLong", | ||
"type": "error" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [], | ||
"name": "EIP712DomainChanged", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "eip712Domain", | ||
"outputs": [ | ||
{ | ||
"internalType": "bytes1", | ||
"name": "fields", | ||
"type": "bytes1" | ||
}, | ||
{ | ||
"internalType": "string", | ||
"name": "name", | ||
"type": "string" | ||
}, | ||
{ | ||
"internalType": "string", | ||
"name": "version", | ||
"type": "string" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "chainId", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "verifyingContract", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "bytes32", | ||
"name": "salt", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "uint256[]", | ||
"name": "extensions", | ||
"type": "uint256[]" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "amount", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "bytes", | ||
"name": "signature", | ||
"type": "bytes" | ||
} | ||
], | ||
"name": "executeTransfer", | ||
"outputs": [], | ||
"stateMutability": "payable", | ||
"type": "function" | ||
}, | ||
{ | ||
"stateMutability": "payable", | ||
"type": "receive" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters