fix: use erc721 artifact
MODIFY
src/common/ContractsBase.ts
src/common/ContractsBase.ts
@@ -3,7 +3,6 @@ import BN from 'bn.js'
import ChildERC20Artifact from 'matic-protocol/contracts-core/artifacts/ChildERC20.json'
import ChildERC721Artifact from 'matic-protocol/contracts-core/artifacts/ChildERC721.json'
import ChildMaticArtifact from 'matic-protocol/contracts-core/artifacts/MaticChildERC20.json'
-import transferWithSigABI from './transferWithSigABI.json'
import { address } from '../types/Common'
export default class ContractsBase {
@@ -25,11 +24,6 @@ export default class ContractsBase {
}
}
- getTokenContractForTransferWithSig(token: address) {
- const web3 = this.web3Client.web3
- return new web3.eth.Contract(transferWithSigABI, token)
- }
-
public getERC20TokenContract(token: address, parent: boolean = false) {
const web3 = parent ? this.web3Client.parentWeb3 : this.web3Client.web3
return new web3.eth.Contract(ChildERC20Artifact.abi, token)

DELETE
src/common/transferWithSigABI.json
-[
- {
- "constant": false,
- "inputs": [
- {
- "internalType": "bytes",
- "name": "sig",
- "type": "bytes"
- },
- {
- "internalType": "uint256",
- "name": "tokenId",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "data",
- "type": "bytes32"
- },
- {
- "internalType": "uint256",
- "name": "expiration",
- "type": "uint256"
- },
- {
- "internalType": "address",
- "name": "to",
- "type": "address"
- }
- ],
- "name": "transferWithSig",
- "outputs": [
- {
- "internalType": "address",
- "name": "",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- }
-]
\ No newline at end of file

MODIFY
src/index.ts
src/index.ts
@@ -217,7 +217,7 @@ export default class Matic extends ContractsBase {
}
)
- const txObj = this.getTokenContractForTransferWithSig(sellOrder.token).methods.transferWithSig(
+ const txObj = this.getERC721TokenContract(sellOrder.token).methods.transferWithSig(
sig,
sellOrder.amount,
data,

fix: use erc721 artifact