Web3_Tutorial icon indicating copy to clipboard operation
Web3_Tutorial copied to clipboard

zks2.0 (EIP 1559)跨链参数修正

Open grassroadsZ opened this issue 3 years ago • 1 comments

感谢大佬的详细文章,修正一点,ABI 的参数可以通过 depositETH 这个方法在js文件中 搜方法,然后对于 EIP 1559 请求构建参数的时候 只需要在原有的参数 里面加个 type 类型即可, 值固定是0x2 ,参考

    params = {

        'gas': 250000,
        'nonce': web3_instance.eth.getTransactionCount(web3_instance.toChecksumAddress(from_address)),
        'from': web3_instance.toChecksumAddress(from_address),
        'value': web3_instance.toWei(l1_amount, "ether"),
        # 'gasPrice': w3.toWei('5', 'gwei'),
        'maxFeePerGas': web3_instance.toWei(5, 'gwei'),
        'maxPriorityFeePerGas': web3_instance.toWei(5, 'gwei'),
        'chainId': 5,
        "type": "0x2",
    }

grassroadsZ avatar May 22 '22 13:05 grassroadsZ

理论上,这应该属于 "goerli链" 的情况,这条链和其他的普通 EVM 兼容链稍微有点区别,甚至在 接入 w3 endpoint 时就有所体现。

我看了你链接的 issue,貌似是去年7月的情况。不清楚新版本是否已经修复这个 "0x2" 的问题了。不过我稍后打算测试下你的这个方法。

感谢指正。

gm365 avatar May 23 '22 06:05 gm365