call直接调用swap的问题

uint amoutout = getAmountOut(amountIn,r0,r1); address to = address(this); bytes4 sig = bytes4(keccak256("swap(uint,uint,address,bytes)"));
bytes memory zbs = new bytes(0);
(bool suc,bytes memory data) = pair.call(abi.encodeWithSelector(sig,0,amoutout,to,zbs)); 一样的参数用接口调swap成功 直接用call失败 https://goerli.etherscan.io/tx/0x68f8bb183749f196b53c3630bf9545a88db8346734c14ddc5ffab3a636437fb0

请先 登录 后评论

1 个回答

Tiny熊 - 布道者
  擅长:智能合约,以太坊
请先 登录 后评论
  • 1 关注
  • 0 收藏,894 浏览
  • 用户_14075 提出于 2023-02-26 02:34

相似问题