makerdao / dss-auto-line

GNU Affero General Public License v3.0
7 stars 15 forks source link

Simplified enable/disable of ilks #7

Closed brianmcmichael closed 3 years ago

brianmcmichael commented 3 years ago

Simplifies the process of adding/updating/removing ilks. Removes the file function.

Addition of an ilk required four external file calls, this replaces additions and updates with an enableIlk(bytes32 ilk, uint256 line, uint256 gap, uint256 ttl) function.

Open to alternative name ideas for functions/events

gbalabasquer commented 3 years ago

We could make on a boolean now, right?

brianmcmichael commented 3 years ago

Actually, we might not even need on anymore, now that I think about it. If we require in setup that line > 0, we can do require(ilks[ilk]).line > 0);, if so, it's enabled, since removing it deletes it from the mapping.

gbalabasquer commented 3 years ago

If we follow this approach maybe we can avoid using on at all and just check that ilkLine > 0.

gbalabasquer commented 3 years ago

lol I hadn't read your comment yeah let's go that way

gbalabasquer commented 3 years ago

But do you want to use require or the if return we have now?

brianmcmichael commented 3 years ago

Updated to remove on and enforce line > 0

brianmcmichael commented 3 years ago

fixed nits