Change approveTokens to approveTokensForDeposit
MODIFY
src/index.js
src/index.js
@@ -82,12 +82,12 @@ export default class Matic {
return this._parentWeb3.eth.accounts.wallet.create(1)
}
- async approveTokens(token, spender, amount, options = {}) {
+ async approveTokensForDeposit(token, amount, options = {}) {
const _tokenContract = new this._parentWeb3.eth.Contract(
StandardTokenArtifacts.abi,
token
)
- const approveTx = await _tokenContract.methods.approve(spender, amount)
+ const approveTx = await _tokenContract.methods.approve(this._rootChainContract, amount)
const _options = await this._fillOptions(
options,
approveTx,

Change approveTokens to approveTokensForDeposit