ali2251 / Upgradable-contracts

Other
39 stars 14 forks source link

storage corruption in Trustless Proxy #4

Open i-stam opened 5 years ago

i-stam commented 5 years ago

Since the Proxy contract is now ownable, then the implementation contracts have to be ownable (or an extra variable has to be defined in the beginning) as well, otherwise the storage is corrupted every time the setScore() function is called.

Additionally, now each user owns his/her own contract, thus, the fallback function has to be protected with the onlyOwner modifier otherwise anyone can delegate calls to the logic contract. This, however, prevents the contract from being sent eth, so another solution can be implemented. something like: if (msg.value == 0 && isOwner()){delegetecall}

i-stam commented 5 years ago

addressed in #5