code-423n4 / 2022-01-xdefi-findings

0 stars 0 forks source link

Critical operations should emit events #106

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

WatchPug

Vulnerability details

Across the contracts, there are certain critical operations that change critical values that affect the users of the protocol.

It's a best practice for these setter functions to emit events to record these changes on-chain for off-chain monitors/tools/interfaces to register the updates and react if necessary.

Instances include:

https://github.com/XDeFi-tech/xdefi-distribution/blob/3856a42df295183b40c6eee89307308f196612fe/contracts/XDEFIDistribution.sol#L73-L75

function setBaseURI(string memory baseURI_) external onlyOwner {
    baseURI = baseURI_;
}
deluca-mike commented 2 years ago

Agreed. Will do.

deluca-mike commented 2 years ago

Duplicate #16