35 字节码特征问题,以及字节码的替换和删除

合约如下

contract Test {
  function test(uint256 value) public returns( uint256 count){
     revert();
     return value;
  }

  function test1(uint256 value) public returns( uint256 count){
     if(value > 1){
       revert("");
     }
     return value;
  }
}

部署后的字节码

0x608060405234801561001057600080fd5b5061020d806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806319ae89941461003b57806329e99f071461006b575b600080fd5b61005560048036038101906100509190610129565b61009b565b6040516100629190610165565b60405180910390f35b61008560048036038101906100809190610129565b6100e9565b6040516100929190610165565b60405180910390f35b600060018211156100e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100d8906101b7565b60405180910390fd5b819050919050565b600080fd5b600080fd5b6000819050919050565b610106816100f3565b811461011157600080fd5b50565b600081359050610123816100fd565b92915050565b60006020828403121561013f5761013e6100ee565b5b600061014d84828501610114565b91505092915050565b61015f816100f3565b82525050565b600060208201905061017a6000830184610156565b92915050565b600082825260208201905092915050565b50565b60006101a1600083610180565b91506101ac82610191565b600082019050919050565b600060208201905081810360008301526101d081610194565b905091905056fea26469706673582212207bb661685431989d3cc4a48f5d959be44af84d0a421af88e60370c9f5d00deee64736f6c634300080f0033

问题

  • 能否直接在字节码中找到revert这一行代码的位置,并删除或者替换掉,在重新部署;
请先 登录 后评论

3 个回答

mike
请先 登录 后评论
gasshadow
请先 登录 后评论
Tiny熊 - 布道者
  擅长:智能合约,以太坊
请先 登录 后评论
  • 3 关注
  • 1 收藏,620 浏览
  • 提出于 2022-10-12 16:56