Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

SKALE-4086 update doc about erc721 approve #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ erc721ABI,
erc721Address
);

let transfer = contractERC721.methods
.transferFrom(
accountForMainnet,
let approve = contractERC721.methods
.approve(
depositBoxAddress,
mintId
)
Expand All @@ -71,23 +70,23 @@ let deposit = depositBox.methods

web3ForMainnet.eth.getTransactionCount(accountForMainnet).then((nonce) => {
//create raw transaction
const rawTxTransfer = {
const rawTxApprove = {
from: accountForMainnet,
nonce: "0x" + nonce.toString(16),
data: transfer,
data: approve,
to: erc721Address,
gas: 6500000,
gasPrice: 100000000000
};
//sign transaction
const txTransfer = new Tx(rawTxTransfer);
txTransfer.sign(privateKey);
const txApprove = new Tx(rawTxApprove);
txApprove.sign(privateKey);

const serializedTxTransfer = txTransfer.serialize();
const serializedTxApprove = txApprove.serialize();

//send signed transaction (approve)
web3ForMainnet.eth
.sendSignedTransaction("0x" + serializedTxTransfer.toString("hex"))
.sendSignedTransaction("0x" + serializedTxApprove.toString("hex"))
.on("receipt", (receipt) => {
console.log(receipt);
web3ForMainnet.eth
Expand Down