Skip to content

fix: only change in logic#3

Open
0xMotto wants to merge 158 commits intomasterfrom
only-logic-changes
Open

fix: only change in logic#3
0xMotto wants to merge 158 commits intomasterfrom
only-logic-changes

Conversation

@0xMotto
Copy link
Collaborator

@0xMotto 0xMotto commented Feb 21, 2023

No description provided.

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xMotto changing the license too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made by someone

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other licence would not verify


function _safeApprove(address token, address spender, uint value) internal {
require(token.code.length > 0);
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, spender, value));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encodeCall is better than encodeWithSelector

@Ceazor
Copy link

Ceazor commented Mar 3, 2023

To-Do

in Gauge.Sol
remove claimFees() from line 721 in notifyRewardAmount()
this function is called when distribute() is called in voter.sol and it the entire source of our mess

@Ceazor
Copy link

Ceazor commented Mar 3, 2023

ToDo2

in Pair.Sol
consider removing

                if (_ratio > 0) {
                index0 += _ratio; }

from both update0() and update1()
or
just set index0 to index1 inside update1()

@Ceazor
Copy link

Ceazor commented Mar 3, 2023

ToDo3

in Voter.sol. review and change to the following and its interfaces

        function killGauge(address _gauge) external {
        require(msg.sender == emergencyCouncil, "not emergency council");
        require(isAlive[_gauge], "gauge already dead");
        isAlive[_gauge] = false;
        claimable[_gauge] = 0;                   <--- this should be removeable
        address _pair = IGauge(_gauge).stake();
        IPair(_pair).setHasGauge(bool false);
        emit GaugeKilled(_gauge);
    }

    function reviveGauge(address _gauge) external {
        require(msg.sender == emergencyCouncil, "not emergency council");
        require(!isAlive[_gauge], "gauge already alive");
        isAlive[_gauge] = true;
        address _pair = IGauge(_gauge).stake();
        IPair(_pair).setHasGauge(bool true);
        emit GaugeRevived(_gauge);
    } 

as seen here
velodrome-finance/contracts@7219a03

@Ceazor
Copy link

Ceazor commented Mar 3, 2023

ToDo4 (consider it)

In pairFactory.sol remove

       require(_fee != 0, "fee must be nonzero");

from setFees() so its possible to turn them all off.

but make sure there isnt /fee *fee issues anywhere.

            if (amount0In > 0) {
                _update0((amount0In * PairFactory(factory).getFee(stable)) / 10000);
            } // accrue fees for token0 and move them out of pool
            if (amount1In > 0) {
                _update1((amount1In * PairFactory(factory).getFee(stable)) / 10000);
             ```
this looks fine. 

@0xMotto 0xMotto force-pushed the only-logic-changes branch from a969b07 to 202aa37 Compare May 1, 2023 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants