smartcontractkit / chainlink-polkadot

Other
139 stars 65 forks source link

Add pallet admin access control to reduce debt #96

Closed mattsse closed 3 years ago

mattsse commented 3 years ago

The check for pallet admin origin within reduce_debt was removed in 62c46380fd84d924f97311eb7a04b96e16bb6c58 this made sense then since feed balances where tracked for the whole pallet and not on a per feed basis, so allowing any account to reduce debt made sense in this setting. Now that endowment and debt is tracked on a per feed basis, the reduce_debt call should be limited again to the pallet admin to remove the exploit scenario where a malicious oracle calls reduce_debt and causes the pallet admin to pay out more funds than intended.