Skip to content

Commit 6538122

Browse files
committed
PoS - Broken links, copy edits
- Update Biconomy CTAs - Copy edits - Modify to make code blocks work - Update contract address CTAs, official Amoy explorer not available, using oklink explorer links
1 parent 6554835 commit 6538122

File tree

2 files changed

+143
-142
lines changed

2 files changed

+143
-142
lines changed

docs/pos/concepts/transactions/meta-transactions.md

Lines changed: 138 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ dApp, and depending on whether you're migrating to meta transactions or building
8989
To integrate your dApp with Meta Transactions on Polygon, you can choose to go with one of the following
9090
relayers or spin up a custom solution:
9191

92-
- [Biconomy](https://docs.biconomy.io/products/enable-gasless-transactions)
92+
- [Biconomy](https://docs.biconomy.io/Account/transactions/gasless)
9393
- [Gas Station Network (GSN)](https://docs.opengsn.org/#ethereum-gas-station-network-gsn)
9494
- [Infura](https://infura.io/product/ethereum/transactions-itx)
9595
- [Gelato](https://docs.gelato.network/developer-products/gelato-relay-sdk)
@@ -106,7 +106,7 @@ The client that the user interacts with (web browser, mobile apps, etc) never in
106106

107107
For any action that requires blockchain interaction,
108108

109-
- Client requests an EIP712 formatted signature from the user
109+
- Client requests an EIP-712 formatted signature from the user
110110
- The signature is sent to a simple relayer server (should have a simple auth/spam protection if used for production, or biconomy's mexa sdk can be used: [https://github.com/bcnmy/mexa-sdk](https://github.com/bcnmy/mexa-sdk))
111111
- The relayer interacts with the blockchain to submit user's signature to the contract. A function on the contract called `executeMetaTransaction` processes the signature and executes the requested transaction (via an internal call).
112112
- The relayer pays for the gas making the transaction effectively free 🤑
@@ -115,14 +115,15 @@ For any action that requires blockchain interaction,
115115

116116
- Choose between a custom simple relayer node/biconomy.
117117

118-
- For biconomy, setup a dapp from the dashboard and save the api-id and api-key, see: [https://docs.biconomy.io/](https://docs.biconomy.io/)
118+
- For Biconomy, setup a dapp from the dashboard and save the api-id and api-key, see: [https://docs.biconomy.io/](https://docs.biconomy.io/)
119119

120120
**Steps:**
121121

122-
1. Let's Register our contracts to biconomy dashboard
123-
1. Visit the [official documents of biconomy](https://docs.biconomy.io/biconomy-dashboard).
124-
2. While registering the dapp, select `Polygon Mumbai`
125-
2. Copy the`API key` to use in frontend
122+
1. Let's register our contracts to Biconomy dashboard
123+
1. Visit [Biconomy's offical docs](https://docs.biconomy.io/dashboard)
124+
2. Navigate and login to the Dashboard
125+
3. Select `Polygon Mumbai` when registering your dapp
126+
2. Copy the`API key` to use for you dapp's frontend
126127
3. And Add function `executeMetaTransaction` in Manage-Api and make sure to enable meta-tx. (Check 'native-metatx' option)
127128

128129
- If you'd like to use your own custom API that sends signed transactions on the blockchain, you can refer to the server code here: [https://github.com/angelagilhotra/ETHOnline-Workshop/tree/master/2-network-agnostic-transfer](https://github.com/angelagilhotra/ETHOnline-Workshop/tree/master/2-network-agnostic-transfer)
@@ -163,140 +164,140 @@ let data = await web3.eth.abi.encodeFunctionCall({
163164
params: msgParams
164165
});
165166

166-
```
167-
168-
- Once you have a relayer and the contracts setup, what is required is for the client to be able to fetch an EIP712 formatted signature and simply call the API with the required parameters
169-
170-
ref: [https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/sign.js#L47](https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/sign.js#L47)
171-
172-
```jsx
173-
174-
let data = await web3.eth.abi.encodeFunctionCall({
175-
name: 'getNonce',
176-
type: 'function',
177-
inputs: [{
178-
name: "user",
179-
type: "address"
180-
}]
181-
}, [accounts[0]]);
182-
183-
let _nonce = await web3.eth.call ({
184-
to: token["80001"],
185-
data
186-
});
187-
188-
const dataToSign = getTypedData({
189-
name: token["name"],
190-
version: '1',
191-
salt: '0x0000000000000000000000000000000000000000000000000000000000013881',
192-
verifyingContract: token["80001"],
193-
nonce: parseInt(_nonce),
194-
from: accounts[0],
195-
functionSignature: functionSig
196-
});
197-
const msgParams = [accounts[0], JSON.stringify(dataToSign)];
198-
199-
let sig = await eth.request ({
200-
method: 'eth_signTypedData_v3',
201-
params: msgParams
202-
});
203-
```
204-
205-
Calling the API, ref: [https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/sign.js#L110](https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/sign.js#L110)
206-
207-
```jsx
208-
const response = await request.post(
209-
'http://localhost:3000/exec', {
210-
json: txObj,
211-
},
212-
(error, res, body) => {
213-
if (error) {
214-
console.error(error)
215-
return
216-
}
217-
document.getElementById(el).innerHTML =
218-
`response:`+ JSON.stringify(body)
219-
}
220-
)
221-
```
222-
223-
If using Biconomy, the following should be called:
224-
225-
```jsx
226-
const response = await request.post(
227-
'https://api.biconomy.io/api/v2/meta-tx/native', {
228-
json: txObj,
229-
},
230-
(error, res, body) => {
231-
if (error) {
232-
console.error(error)
233-
return
234-
}
235-
document.getElementById(el).innerHTML =
236-
`response:`+ JSON.stringify(body)
237-
}
238-
)
239-
```
240-
241-
where the `txObj` should look something like:
242-
243-
```json
244-
{
245-
"to": "0x2395d740789d8C27C139C62d1aF786c77c9a1Ef1",
246-
"apiId": <API ID COPIED FROM THE API PAGE>,
247-
"params": [
248-
"0x2173fdd5427c99357ba0dd5e34c964b08079a695",
249-
"0x2e1a7d4d000000000000000000000000000000000000000000000000000000000000000a",
250-
"0x42da8b5ac3f1c5c35c3eb38d639a780ec973744f11ff75b81bbf916300411602",
251-
"0x32bf1451a3e999b57822bc1a9b8bfdfeb0da59aa330c247e4befafa997a11de9",
252-
"27"
253-
],
254-
"from": "0x2173fdd5427c99357ba0dd5e34c964b08079a695"
167+
```
168+
169+
- Once you have a relayer and the contracts set up, what is required is for the client to be able to fetch an EIP-712 formatted signature and simply call the API with the required parameters
170+
171+
ref: [https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/sign.js#L47](https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/sign.js#L47)
172+
173+
```jsx
174+
175+
let data = await web3.eth.abi.encodeFunctionCall({
176+
name: 'getNonce',
177+
type: 'function',
178+
inputs: [{
179+
name: "user",
180+
type: "address"
181+
}]
182+
}, [accounts[0]]);
183+
184+
let _nonce = await web3.eth.call ({
185+
to: token["80001"],
186+
data
187+
});
188+
189+
const dataToSign = getTypedData({
190+
name: token["name"],
191+
version: '1',
192+
salt: '0x0000000000000000000000000000000000000000000000000000000000013881',
193+
verifyingContract: token["80001"],
194+
nonce: parseInt(_nonce),
195+
from: accounts[0],
196+
functionSignature: functionSig
197+
});
198+
const msgParams = [accounts[0], JSON.stringify(dataToSign)];
199+
200+
let sig = await eth.request ({
201+
method: 'eth_signTypedData_v3',
202+
params: msgParams
203+
});
204+
```
205+
206+
Calling the API, ref: [https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/sign.js#L110](https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/sign.js#L110)
207+
208+
```jsx
209+
const response = await request.post(
210+
'http://localhost:3000/exec', {
211+
json: txObj,
212+
},
213+
(error, res, body) => {
214+
if (error) {
215+
console.error(error)
216+
return
217+
}
218+
document.getElementById(el).innerHTML =
219+
`response:`+ JSON.stringify(body)
255220
}
256-
```
221+
)
222+
```
257223

258-
- If you use the custom API it executes the `executeMetaTransaction` function on the contract:
224+
If using Biconomy, the following should be called:
259225

260-
(ref: [https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/server/index.js#L40](https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/server/index.js#L40))
261-
262-
```jsx
263-
try {
264-
let tx = await contract.methods.executeMetaTransaction(
265-
txDetails.from, txDetails.fnSig, r, s, v
266-
).send ({
267-
from: user,
268-
gas: 800000
269-
})
270-
req.txHash = tx.transactionHash
271-
} catch (err) {
272-
console.log (err)
273-
next(err)
226+
```jsx
227+
const response = await request.post(
228+
'https://api.biconomy.io/api/v2/meta-tx/native', {
229+
json: txObj,
230+
},
231+
(error, res, body) => {
232+
if (error) {
233+
console.error(error)
234+
return
274235
}
275-
```
276-
277-
is using biconomy, the client side call looks like:
278-
279-
```jsx
280-
// client/src/App.js
281-
import React from "react";
282-
import Biconomy from "@biconomy/mexa";
283-
284-
const getWeb3 = new Web3(biconomy);
285-
biconomy
286-
.onEvent(biconomy.READY, () => {
287-
// Initialize your dapp here like getting user accounts etc
288-
console.log("Mexa is Ready");
289-
})
290-
.onEvent(biconomy.ERROR, (error, message) => {
291-
// Handle error while initializing mexa
292-
console.error(error);
293-
});
294-
295-
/**
296-
* use the getWeb3 object to define a contract and calling the function directly
297-
*/
298-
299-
```
236+
document.getElementById(el).innerHTML =
237+
`response:`+ JSON.stringify(body)
238+
}
239+
)
240+
```
241+
242+
where the `txObj` should look something like:
243+
244+
```json
245+
{
246+
"to": "0x2395d740789d8C27C139C62d1aF786c77c9a1Ef1",
247+
"apiId": <API ID COPIED FROM THE API PAGE>,
248+
"params": [
249+
"0x2173fdd5427c99357ba0dd5e34c964b08079a695",
250+
"0x2e1a7d4d000000000000000000000000000000000000000000000000000000000000000a",
251+
"0x42da8b5ac3f1c5c35c3eb38d639a780ec973744f11ff75b81bbf916300411602",
252+
"0x32bf1451a3e999b57822bc1a9b8bfdfeb0da59aa330c247e4befafa997a11de9",
253+
"27"
254+
],
255+
"from": "0x2173fdd5427c99357ba0dd5e34c964b08079a695"
256+
}
257+
```
258+
259+
- If you use the custom API it executes the `executeMetaTransaction` function on the contract:
260+
261+
(ref: [https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/server/index.js#L40](https://github.com/angelagilhotra/ETHOnline-Workshop/blob/6b615b8a4ef00553c17729c721572529303c8e1b/2-network-agnostic-transfer/server/index.js#L40))
262+
263+
```jsx
264+
try {
265+
let tx = await contract.methods.executeMetaTransaction(
266+
txDetails.from, txDetails.fnSig, r, s, v
267+
).send ({
268+
from: user,
269+
gas: 800000
270+
})
271+
req.txHash = tx.transactionHash
272+
} catch (err) {
273+
console.log (err)
274+
next(err)
275+
}
276+
```
277+
278+
is using biconomy, the client side call looks like:
279+
280+
```jsx
281+
// client/src/App.js
282+
import React from "react";
283+
import Biconomy from "@biconomy/mexa";
284+
285+
const getWeb3 = new Web3(biconomy);
286+
biconomy
287+
.onEvent(biconomy.READY, () => {
288+
// Initialize your dapp here like getting user accounts etc
289+
console.log("Mexa is Ready");
290+
})
291+
.onEvent(biconomy.ERROR, (error, message) => {
292+
// Handle error while initializing mexa
293+
console.error(error);
294+
});
295+
296+
/**
297+
* use the getWeb3 object to define a contract and calling the function directly
298+
*/
299+
300+
```
300301

301302
Account Abstraction is a blockchain technology that enables users to utilize smart contracts as their accounts. While the default account for most users is an Externally Owned Account (EOA), which is controlled by an external private key, it requires users to have a considerable understanding of blockchain technology to use them securely. Fortunately, smart contract accounts can create superior user experiences.
302303

docs/pos/reference/contracts/genesis-contracts.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ Here you will find a list of contracts deployed on Polygon together with their i
9292

9393
| Contracts | Address |
9494
|-----------------------|--------------------------------------------|
95-
| ChildChain | [0x4f9cd8a945EE035523979D7A120a23999D17D8C0](https://amoy.polygonscan.com/address/0x4f9cd8a945EE035523979D7A120a23999D17D8C0/) |
96-
| EIP1559Burn | [0xeCDD77cE6f146cCf5dab707941d318Bd50eeD2C9](https://amoy.polygonscan.com/address/0xeCDD77cE6f146cCf5dab707941d318Bd50eeD2C9/) |
95+
| ChildChain | [0x4f9cd8a945EE035523979D7A120a23999D17D8C0](https://www.oklink.com/amoy/address/0x4f9cd8a945EE035523979D7A120a23999D17D8C0/) |
96+
| EIP1559Burn | [0xeCDD77cE6f146cCf5dab707941d318Bd50eeD2C9](https://www.oklink.com/amoy/address/0xeCDD77cE6f146cCf5dab707941d318Bd50eeD2C9/) |
9797
| **Tokens** | |
98-
| MaticToken | [0x0000000000000000000000000000000000001010](https://amoy.polygonscan.com/address/0x0000000000000000000000000000000000001010/) |
99-
| MaticWeth | [0x41Dc3C8eB8368bd9139Cec50434a0C294c8c1102](https://amoy.polygonscan.com/address/0x41Dc3C8eB8368bd9139Cec50434a0C294c8c1102/) |
100-
| RootERC721 | [0x3ADBC484Ff0cFEb657e1A9AF8F3CB16DC0B53e7e](https://amoy.polygonscan.com/address/0x3ADBC484Ff0cFEb657e1A9AF8F3CB16DC0B53e7e/) |
98+
| MaticToken | [0x0000000000000000000000000000000000001010](https://www.oklink.com/amoy/address/0x0000000000000000000000000000000000001010/) |
99+
| MaticWeth | [0x41Dc3C8eB8368bd9139Cec50434a0C294c8c1102](https://www.oklink.com/amoy/address/0x41Dc3C8eB8368bd9139Cec50434a0C294c8c1102/) |
100+
| RootERC721 | [0x3ADBC484Ff0cFEb657e1A9AF8F3CB16DC0B53e7e](https://www.oklink.com/amoy/address/0x3ADBC484Ff0cFEb657e1A9AF8F3CB16DC0B53e7e/) |
101101

102102

103103

0 commit comments

Comments
 (0)