资源加载中... loading...

支持encodePacked

例如在Uniswap V3这个DEX的方法调用时,需要传入兑换路径之类的参数,就需要使用encodePacked操作:

function main() {
    var fee = exchange.IO("encodePacked", "uint24", 3000)
    var tokenInAddress = "0x111111111117dC0aa78b770fA6A738034120C302"
    var tokenOutAddress = "0x6b175474e89094c44da98b954eedeac495271d0f"
    var path = tokenInAddress.slice(2).toLowerCase()
    path += fee + tokenOutAddress.slice(2).toLowerCase()
    Log("path:", path)
}
支持encode 支持decode