CRYPTO NEWS

Brownie Reverting Transactions With No Description Of Error

Getting error on add liquidity function with no description of the error.

Error:

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 

Using copied CSAMM code from: https://solidity-by-example.org/defi/constant-sum-amm ERC20: https://solidity-by-example.org/app/erc20

Setting gas or else the CSAMM wont deploy right before hand

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'>  

Thank you for any help!

Lightning: why do we need decrementing timelocks in multi-hop payments?

The video (at 28:25) from the official Lightning website describes a multi-hop payment. I understand what a hash-locked contract is, but I still don’t understand why we need a timelock aspect here. As you see on the slide, in a multi-hop payment A -> B -> C -> D, (A -> B) has a 3-day::Listen

The video (at 28:25) from the official Lightning website describes a multi-hop payment. I understand what a hash-locked contract is, but I still don’t understand why we need a timelock aspect here. As you see on the slide, in a multi-hop payment A -> B -> C -> D, (A -> B) has a 3-day nLockTime, (B -> C) has a 2-day nLockTime, and (C -> D) has a 1-day nLockTime. nLockTime of time t means that the transaction can not be included in a block earlier than t. So as time passes, first the (C -> D) becomes valid, then (B -> C) becomes valid, then (A -> B) becomes valid.

Joseph Poon says at 28:35 (emphasis mine):

“Dave’s and Carol’s channel […] closes first. And Carol is happy with this setup, because she knows that her payment closes out […] before her money gets pulled.”

Isnt’s it the other way around: Dave pulls money from Carol first (between day 1 and day 2), and then Carol pulls money from Bob?

Anyway, what would go wrong if we got rid of timelocks altogether? Say, Dave generates a random R, sends H(R) to Alice, Alice creates a hash-locked transaction and broadcasts it to Dave via Bob and Carol. If Dave discoses R, everyone can withdraw their funds, if he doesn’t, no one can. Why do we need timelocks on top of that?

Crypto Hats, Crypto Shirts, Crypto Socks, Crypto Clothing

Brownie Reverting Transactions With No Description Of Error

Shopping cart
There are no products in the cart!
Continue shopping
0