Makes library return max(estimated_cost, loan_size * 0.01) so that the user will never have 0 for estimated costs. This will increase the chances of the transaction going through successfully, and they'll get a refund in those cases.
Added a constraint to openCdp that ensures the contract ends with the same amount of WETH it started with. This should never fail, but if someone finds a way to attack the contract this is an added layer of protection. This change blew the stack depth limit, so I had to extract some code out into a helper function.
Makes library return
max(estimated_cost, loan_size * 0.01)
so that the user will never have 0 for estimated costs. This will increase the chances of the transaction going through successfully, and they'll get a refund in those cases.Added a constraint to
openCdp
that ensures the contract ends with the same amount of WETH it started with. This should never fail, but if someone finds a way to attack the contract this is an added layer of protection. This change blew the stack depth limit, so I had to extract some code out into a helper function.