Ganache

沒有錯誤描述的布朗尼恢復交易

  • June 20, 2022

添加流動性功能時出現錯誤,沒有錯誤描述。

錯誤:

CSAMM.addLiquidity  0:334  [476 / 29510689 gas]
│   
└── ERC201.transferFrom  [CALL]  123:322  [29510213 gas]
       ├── address: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
       ├── value: 0
       ├── input arguments:
       │   ├── sender: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
       │   ├── recipient: 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707
       │   └── amount: 50
       └── revert reason: 0x4e487b710000000000000000000000000000000000000000000000000000000000000011

使用從以下位置複製的 CSAMM 程式碼: https ://solidity-by-example.org/defi/constant-sum-amm ERC20: https ://solidity-by-example.org/app/erc20

設置氣體,否則 CSAMM 不會立即部署

some_gas_price = 500000000
CSAMM.deploy('0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512','0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0', {'from': accounts[0], "gas_price": some_gas_price})
Transaction sent: 0xa69ee008cf0550bd78979a4c91bdf86fcab0d71f1b8bdb06d9d2071ee4e5ace9
 Gas price: 0.5 gwei   Gas limit: 30000000   Nonce: 12
 CSAMM.constructor confirmed   Block: 13   Gas used: 711227 (2.37%)
 CSAMM deployed at: 0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0

<CSAMM Contract '0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0'>

感謝您的任何幫助!

我不同意花費我的 erc20s

引用自:https://ethereum.stackexchange.com/questions/130408