makerdao / testchain

Start a local test chain with the MakerDAO contracts deployed on it, quickly and easily.
MIT License
33 stars 29 forks source link

Transaction failed - Revert reason: Vat/dust #43

Closed akuehlka closed 3 years ago

akuehlka commented 3 years ago

I'm trying to follow the testchain guide. Every time I get stuck at the point where I'm supposed to lock the collateral and generate DAI: seth send $CDP_MANAGER 'frob(uint256,int256,int256)' $cdpId $dink $dart The transaction fails, and this is what ganache shows me:

eth_sendTransaction

  Transaction: 0x6b9d74eeb474865230f1abcca7ef852a82b1fb8bd88b60795677ade729280c11
  Gas usage: 53046
  Block Number: 472
  Block Time: Tue Oct 06 2020 11:18:40 GMT-0300 (Brasilia Standard Time)
  Runtime Error: revert
  Revert reason: Vat/dust

But I can't figure out what I have to do to make it work. Is it an error in the testchain guide? Did someone else find this problem?

gbalabasquer commented 3 years ago

"Revert reason: Vat/dust" https://github.com/makerdao/dss/blob/master/src/vat.sol#L195 You need to generate more DAI. I think the default dust now is set to 100 DAI.

akuehlka commented 3 years ago

"Revert reason: Vat/dust" https://github.com/makerdao/dss/blob/master/src/vat.sol#L195 You need to generate more DAI. I think the default dust now is set to 100 DAI.

That worked. Thank you!

akuehlka commented 3 years ago

@gbalabasquer Although your suggestion fixed the frob transaction in the sense that it went through, I still don't get the result I was expecting. My new transaction was sent using this:

export dink=$(seth --to-uint256 $(seth --to-hex $(seth --to-wei 300 eth)))
export dart=$(seth --to-uint256 $(seth --to-hex $(seth --to-wei 150 eth)))
seth send $CDP_MANAGER 'frob(uint256,int256,int256)' $cdpId $dink $dart

However when I do mcd frobs to check the result, this is what I get:

ilk ETH-A
urn 0x3a7a2fb3a7f3561296e475f21207738dcdf4393d
dink 300.000000000000000000
dart 0.000000000000000000
tx: 0x6688fead0e90d6897bc5d55e2917114465198c574edca0847f198193e2a9c9f0
block: 471

Shouldn't dart be 150 here? What happened?

gbalabasquer commented 3 years ago

Run directly seth call $MCD_VAT 'dai(address)(uint256)' 0x3a7a2fb3a7f3561296e475f21207738dcdf4393d If that returns you the 150 DAI, then there is a problem in mcd frobs. Not really sure which version of mcd-cli you are using.

akuehlka commented 3 years ago

Thanks for the reply.

Yes, it looks like it works this way: seth call $MCD_VAT 'dai(address)(uint256)' 0x3a7a2fb3a7f3561296e475f21207738dcdf4393d returns 150000000000000000000000000000000000000000000000 I'm using mcd 1.0.7-rc1.

gbalabasquer commented 3 years ago

@brianmcmichael not really sure if happening with the latest version of mcd-cli but just in case ^^

brianmcmichael commented 3 years ago

Can confirm this appears to be a bug in mcd-cli. The mainnet version of dss does not include all of the arguments in the log, which mcd-cli parses to determine dink and dart.

I'll make a ticket to look into parsing the tx parameters to get this data.