axelarnetwork / support

Your source for support with the Axelar Network
3 stars 1 forks source link

`MINT_BURN_FROM` token manager type doesn't work #124

Closed SKYBITDev3 closed 2 months ago

SKYBITDev3 commented 3 months ago

In the custom token example I changed CUSTOM_MINT_BURN to 1 to try the MINT_BURN_FROM token manager type at https://github.com/axelarnetwork/axelar-examples/blob/691ff3b61ed441b483d14d323595002f7ea8b423/examples/evm/its-custom-token/index.js#L39

I then added await (await source.customToken.approve(tokenManager.address, amount)).wait() at https://github.com/axelarnetwork/axelar-examples/blob/691ff3b61ed441b483d14d323595002f7ea8b423/examples/evm/its-custom-token/index.js#L54

and import { ERC20Burnable } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; at https://github.com/axelarnetwork/axelar-examples/blob/691ff3b61ed441b483d14d323595002f7ea8b423/examples/evm/its-custom-token/CustomToken.sol#L9

and ERC20Burnable at https://github.com/axelarnetwork/axelar-examples/blob/691ff3b61ed441b483d14d323595002f7ea8b423/examples/evm/its-custom-token/CustomToken.sol#L15

I then ran npm run build, restarted the environment with npm run start and redeployed with npm run deploy evm/its-custom-token local.

Then when I run npm run execute evm/its-custom-token local "Fantom" "Avalanche" a lot of error output appears. The failure happens at https://github.com/axelarnetwork/axelar-examples/blob/691ff3b61ed441b483d14d323595002f7ea8b423/scripts/libs/its-utils.js#L22

When checking the allowance using await source.customToken.allowance(wallet.address, tokenManager.address) the value is correct.

Please fix this ASAP.

SKYBITDev3 commented 3 months ago

Should IERC20 in https://github.com/axelarnetwork/interchain-token-service/blob/56e9084766280055c664e41e31ca59edac1af62a/contracts/TokenHandler.sol#L221 instead be IERC20BurnableFrom?

benjamin852 commented 3 months ago

Hey, thanks for calling this out. I will work on a separate example for MINT_BURN_FROM usecase for you and others to follow. Can you share the error which you're receiving? Thanks

SKYBITDev3 commented 3 months ago
<ref *1> Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"cannot estimate gas; transaction may fail or may require manual gas limit","code":"UNPREDICTABLE_GAS_LIMIT","error":{"reason":"processing response error","code":"SERVER_ERROR","body":"{\"id\":122,\"jsonrpc\":\"2.0\",\"error\":{\"message\":\"VM Exception while processing transaction: revert\",\"stack\":\"RuntimeError: VM Exception while processing transaction: revert\\n    at exactimate (D:\\\\Documents\\\\Projects\\\\axelar-examples\\\\node_modules\\\\ganache\\\\dist\\\\node\\\\1.js:2:166011)\",\"code\":-32000,\"name\":\"RuntimeError\",\"data\":{\"hash\":null,\"programCounter\":132,\"result\":\"0x1a59c9bd00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004045c4b0200000000000000000000000000000000000000000000000000000000\",\"reason\":null,\"message\":\"revert\"}}}","error":{"code":-32000,"data":{"hash":null,"programCounter":132,"result":"0x1a59c9bd00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004045c4b0200000000000000000000000000000000000000000000000000000000","reason":null,"message":"revert"}},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x5a66bb22\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"value\":\"0x190ce47f6d47f05a\",\"from\":\"0xa87dbea1579680d89c606578505096d72480d193\",\"to\":\"0xc13323a75343432bc9c5db570532ecb9eb07f812\",\"data\":\"0xda081c73730c9db880f188283146bd2deb4e6c4a2e813d3cc82c1a232c59943d861757a600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000190ce47f6d47f05a00000000000000000000000000000000000000000000000000000000000000094176616c616e63686500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014a87dbea1579680d89c606578505096d72480d1930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"}],\"id\":122,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://localhost:8500/2"},"method":"estimateGas","transaction":{"from":"0xA87DBEA1579680D89c606578505096d72480D193","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x5a66bb22"},"to":"0xc13323a75343432Bc9C5db570532eCB9EB07f812","value":{"type":"BigNumber","hex":"0x190ce47f6d47f05a"},"data":"0xda081c73730c9db880f188283146bd2deb4e6c4a2e813d3cc82c1a232c59943d861757a600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000190ce47f6d47f05a00000000000000000000000000000000000000000000000000000000000000094176616c616e63686500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014a87dbea1579680d89c606578505096d72480d1930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","type":2,"accessList":null}}, tx={"data":"0xda081c73730c9db880f188283146bd2deb4e6c4a2e813d3cc82c1a232c59943d861757a600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000190ce47f6d47f05a00000000000000000000000000000000000000000000000000000000000000094176616c616e63686500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014a87dbea1579680d89c606578505096d72480d1930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","to":{},"from":"0xA87DBEA1579680D89c606578505096d72480D193","value":{"type":"BigNumber","hex":"0x190ce47f6d47f05a"},"type":2,"maxFeePerGas":{"type":"BigNumber","hex":"0x5a66bb22"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"nonce":{},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.7.0)
    at Logger.makeError (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\logger\lib\index.js:238:21)
    at Logger.throwError (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\logger\lib\index.js:247:20)
    at D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\abstract-signer\lib\index.js:365:47
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)       
    at async Promise.all (index 8) {
  reason: 'cannot estimate gas; transaction may fail or may require manual gas limit',  
  code: 'UNPREDICTABLE_GAS_LIMIT',
  error: Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"id\":122,\"jsonrpc\":\"2.0\",\"error\":{\"message\":\"VM Exception while processing transaction: revert\",\"stack\":\"RuntimeError: VM Exception while processing transaction: revert\\n    at exactimate (D:\\\\Documents\\\\Projects\\\\axelar-examples\\\\node_modules\\\\ganache\\\\dist\\\\node\\\\1.js:2:166011)\",\"code\":-32000,\"name\":\"RuntimeError\",\"data\":{\"hash\":null,\"programCounter\":132,\"result\":\"0x1a59c9bd00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004045c4b0200000000000000000000000000000000000000000000000000000000\",\"reason\":null,\"message\":\"revert\"}}}","error":{"code":-32000,"data":{"hash":null,"programCounter":132,"result":"0x1a59c9bd00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004045c4b0200000000000000000000000000000000000000000000000000000000","reason":null,"message":"revert"}},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x5a66bb22\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"value\":\"0x190ce47f6d47f05a\",\"from\":\"0xa87dbea1579680d89c606578505096d72480d193\",\"to\":\"0xc13323a75343432bc9c5db570532ecb9eb07f812\",\"data\":\"0xda081c73730c9db880f188283146bd2deb4e6c4a2e813d3cc82c1a232c59943d861757a600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000190ce47f6d47f05a00000000000000000000000000000000000000000000000000000000000000094176616c616e63686500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014a87dbea1579680d89c606578505096d72480d1930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"}],\"id\":122,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://localhost:8500/2"}, method="estimateGas", transaction={"from":"0xA87DBEA1579680D89c606578505096d72480D193","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x5a66bb22"},"to":"0xc13323a75343432Bc9C5db570532eCB9EB07f812","value":{"type":"BigNumber","hex":"0x190ce47f6d47f05a"},"data":"0xda081c73730c9db880f188283146bd2deb4e6c4a2e813d3cc82c1a232c59943d861757a600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000190ce47f6d47f05a00000000000000000000000000000000000000000000000000000000000000094176616c616e63686500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014a87dbea1579680d89c606578505096d72480d1930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","type":2,"accessList":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)
      at Logger.makeError (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\logger\lib\index.js:238:21)
      at Logger.throwError (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\logger\lib\index.js:247:20)
      at checkError (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:175:16)
      at JsonRpcProvider.<anonymous> (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:751:47)
      at step (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:48:23)
      at Object.throw (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:29:53)
      at rejected (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:21:65)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {   
    reason: 'cannot estimate gas; transaction may fail or may require manual gas limit',
    code: 'UNPREDICTABLE_GAS_LIMIT',
    error: Error: processing response error (body="{\"id\":122,\"jsonrpc\":\"2.0\",\"error\":{\"message\":\"VM Exception while processing transaction: revert\",\"stack\":\"RuntimeError: VM Exception while processing transaction: revert\\n    at exactimate (D:\\\\Documents\\\\Projects\\\\axelar-examples\\\\node_modules\\\\ganache\\\\dist\\\\node\\\\1.js:2:166011)\",\"code\":-32000,\"name\":\"RuntimeError\",\"data\":{\"hash\":null,\"programCounter\":132,\"result\":\"0x1a59c9bd00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004045c4b0200000000000000000000000000000000000000000000000000000000\",\"reason\":null,\"message\":\"revert\"}}}", error={"code":-32000,"data":{"hash":null,"programCounter":132,"result":"0x1a59c9bd00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004045c4b0200000000000000000000000000000000000000000000000000000000","reason":null,"message":"revert"}}, requestBody="{\"method\":\"eth_estimateGas\",\"params\":[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x5a66bb22\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"value\":\"0x190ce47f6d47f05a\",\"from\":\"0xa87dbea1579680d89c606578505096d72480d193\",\"to\":\"0xc13323a75343432bc9c5db570532ecb9eb07f812\",\"data\":\"0xda081c73730c9db880f188283146bd2deb4e6c4a2e813d3cc82c1a232c59943d861757a600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000190ce47f6d47f05a00000000000000000000000000000000000000000000000000000000000000094176616c616e63686500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014a87dbea1579680d89c606578505096d72480d1930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"}],\"id\":122,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="http://localhost:8500/2", code=SERVER_ERROR, version=web/5.7.1)
        at Logger.makeError (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\logger\lib\index.js:238:21)
        at Logger.throwError (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\logger\lib\index.js:247:20)
        at D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\web\lib\index.js:313:32
        at step (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\web\lib\index.js:33:23)
        at Object.next (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\web\lib\index.js:14:53)
        at fulfilled (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\web\lib\index.js:5:58)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { 
      reason: 'processing response error',
      code: 'SERVER_ERROR',
      body: '{"id":122,"jsonrpc":"2.0","error":{"message":"VM Exception while processing transaction: revert","stack":"RuntimeError: VM Exception while processing transaction: revert\\n    at exactimate (D:\\\\Documents\\\\Projects\\\\axelar-examples\\\\node_modules\\\\ganache\\\\dist\\\\node\\\\1.js:2:166011)","code":-32000,"name":"RuntimeError","data":{"hash":null,"programCounter":132,"result":"0x1a59c9bd00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004045c4b0200000000000000000000000000000000000000000000000000000000","reason":null,"message":"revert"}}}',
      error: Error: VM Exception while processing transaction: revert
          at getResult (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:191:21)
          at processJsonFunc (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\web\lib\index.js:356:22)
          at D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\web\lib\index.js:288:46
          at step (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\web\lib\index.js:33:23)
          at Object.next (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\web\lib\index.js:14:53)
          at fulfilled (D:\Documents\Projects\axelar-examples\node_modules\@ethersproject\web\lib\index.js:5:58)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
        code: -32000,
        data: {
          hash: null,
          programCounter: 132,
          result: '0x1a59c9bd00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004045c4b0200000000000000000000000000000000000000000000000000000000',
          reason: null,
          message: 'revert'
        }
      },
      requestBody: '{"method":"eth_estimateGas","params":[{"type":"0x2","maxFeePerGas":"0x5a66bb22","maxPriorityFeePerGas":"0x59682f00","value":"0x190ce47f6d47f05a","from":"0xa87dbea1579680d89c606578505096d72480d193","to":"0xc13323a75343432bc9c5db570532ecb9eb07f812","data":"0xda081c73730c9db880f188283146bd2deb4e6c4a2e813d3cc82c1a232c59943d861757a600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000190ce47f6d47f05a00000000000000000000000000000000000000000000000000000000000000094176616c616e63686500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014a87dbea1579680d89c606578505096d72480d1930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}],"id":122,"jsonrpc":"2.0"}',
      requestMethod: 'POST',
      url: 'http://localhost:8500/2'
    },
    method: 'estimateGas',
    transaction: {
      from: '0xA87DBEA1579680D89c606578505096d72480D193',
      maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },       
      maxFeePerGas: BigNumber { _hex: '0x5a66bb22', _isBigNumber: true },
      to: '0xc13323a75343432Bc9C5db570532eCB9EB07f812',
      value: BigNumber { _hex: '0x190ce47f6d47f05a', _isBigNumber: true },
      data: '0xda081c73730c9db880f188283146bd2deb4e6c4a2e813d3cc82c1a232c59943d861757a600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000190ce47f6d47f05a00000000000000000000000000000000000000000000000000000000000000094176616c616e63686500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014a87dbea1579680d89c606578505096d72480d1930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
      type: 2,
      accessList: null
    }
  },
  tx: {
00000000003e80000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000190ce47f6d47f05a00000000000000000000000000000000000000000000000000000000000000094176616c616e63686500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014a87dbea1579680d89c606578505096d72480d1930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
    to: Promise { '0xc13323a75343432Bc9C5db570532eCB9EB07f812' },
    from: '0xA87DBEA1579680D89c606578505096d72480D193',
    value: BigNumber { _hex: '0x190ce47f6d47f05a', _isBigNumber: true },
    type: 2,
    maxFeePerGas: BigNumber { _hex: '0x5a66bb22', _isBigNumber: true },
    maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },
    nonce: Promise { 13 },
    gasLimit: Promise { <rejected> [Circular *1] },
    chainId: Promise { 2502 }
  }
}

Node.js v18.20.3
SKYBITDev3 commented 2 months ago

I will work on a separate example for MINT_BURN_FROM usecase for you and others to follow.

Did you find the problem?

We're eagerly looking forward to try a working example.

benjamin852 commented 2 months ago

Hey! Yes there should be a working example now for MINT_BURN_FROM token manager in the examples repo. (As merged in this pr)

SKYBITDev3 commented 2 months ago

Thank you @benjamin852. I now see in the example that it's the Interchain Token Service that needs to be granted approval to spend the tokens, not the Token Manager.

So is this correct?: For minting tokens at the destination, permission needs to be given to the Token Manager. But when using the MINT_BURN_FROM Token Manager type, permission needs to be given to the Interchain Token Service for burning tokens at the source.

The platform documentation doesn't describe this, so you probably should add it.

benjamin852 commented 2 months ago

Ya because under the hood MINT_BURN_FROM is calling the transferFrom() burnFrom() function on the token so it will revert if the allowance is not increased. Thank you for the feedback will look into updating this.

SKYBITDev3 commented 2 months ago

What I mean is that it's unintuitive to need to grant approval to the Interchain Token Service instead of the Token Manager. With the MINT_BURN token type, only the Token Manager needs to be granted permission to both mint and burn tokens, right?

SKYBITDev3 commented 2 months ago

under the hood MINT_BURN_FROM is calling the transferFrom() function

Isn't it burnFrom() at https://github.com/axelarnetwork/interchain-token-service/blob/56e9084766280055c664e41e31ca59edac1af62a/contracts/TokenHandler.sol#L221?

You got burnFrom() by adding ERC20Burnable at https://github.com/axelarnetwork/axelar-examples/blob/457f37cd52a270f9d761b54e7660c70adf2a176f/examples/evm/its-mint-burn-from/BurnableToken.sol#L6

If you only intend to call transferFrom() then ERC20Burnable isn't needed, but it's better to call burnFrom() if it exists in the token, and only if it doesn't then fall back to transferFrom() to transfer to zero address.

benjamin852 commented 2 months ago

Yes, sorry, I meant burnFrom() not transferFrom(). Why would you want to approve the manager? The TokenHandler (which is delegate called by ITS) is interacting with token contract directly the manager is not being used in the src chain token burning (asides from updating the flowLimit in response to the interchain transfer). On MINT_BURN you can see in the example the manager is not granted approval anywhere since there is no burnFrom or tranferFrom function when the token is being minted/burnt. The manager is still whitelisted to call mint/burn functions on the token itself but that is different than incrementing the allowance to trigger burnFrom() function like we're doing in the case of the MINT_BURN_FROM manager.

SKYBITDev3 commented 2 months ago

Why would you want to approve the manager

Because with MINT_BURN we only need to give permission to the Token Manager alone for both burning and minting (by granting it MINTER role) so that it call burn() and mint().

With MINT_BURN_FROM we no longer have burn() in the token, so instead approval would need to be granted to the burner to call burnFrom(), and (without examining the platform code) we'd intuitively think it's still the Token Manager that would do the burning much like with MINT_BURN.

As it's not actually the Token Manager that should be given approval when its type is MINT_BURN_FROM, the platform documentation should state that approval needs to be granted to the Interchain Token Service instead.

benjamin852 commented 2 months ago

I see what you mean thanks for raising this. I will make sure there is a note on this added in the docs.

SKYBITDev3 commented 2 months ago

I think you should also add transferFrom() as a fallback because most tokens don't have burnFrom() as it requires explicit addition to the contract code before deployment e.g. inheriting ERC20Burnable from @openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol.

So if burnFrom() isn't found then call transferFrom() with the zero address as destination.

benjamin852 commented 2 months ago

If it's transferFrom() the to address wont necessarily be the 0 address also the two functions have two different function signatures so it doesn't really flow very clean. Working on the doc you suggested in your previous comment regarding token manager, thanks for all the feedback here!