320d6262af1b28ed72fe8533f43e1e38ee75c98f
- Forked code for governance contracts and token implementation from following sources:
Uni.sol
from Uniswap/governance/contracts/Uni.solSafeMath.sol
from Uniswap/governance/contracts/SafeMath.solTimelock.sol
from ampleforth/Forth/contracts/Timelock.solGovernorBravoDelegate.sol
from ampleforth/Forth/contracts/GovernorBravoDelegate.solGovernorBravoDelegator.sol
from ampleforth/Forth/contracts/GovernorBravoDelegator.solGovernorBravoInterfaces.sol
from ampleforth/Forth/contracts/GovernorBravoInterfaces.sol
38b3a8d87f415325989626c4aa987aad0d3b4307
- Renamed as follows:
- Renamed all instances of "FORTH" to "HIFI"
- Renamed all instances of "UNI" to "HIFI"
- Renamed all instances of "Forth" to "Hifi"
- Renamed all instances of "Uni" to "Hifi"
- Renamed all instances of "forth" to "hifi"
- Renamed all instances of "uni" to "hifi"
- Renamed all instances of "Ampleforth" to "Hifi"
- Renamed all instances of "Uniswap" to "Hifi Finance"
- Remove
public
visibility modifier from Hifi token constructor. - Add
@notice
NatSpec tags to comments insideGovernorBravoInterfaces.sol
to improve interface documentation. - Fix typo in
initialize(...)
function comment inGovernorBravoDelegate.sol
.
4fafc8b8db71db51730c8587e3235846123962e6
- Upgraded Solidity version to ^0.8.15, which also triggered the following changes:
- Removed superfluous
pragma experimental ABIEncoderV2;
directives, sinceABIEncoderV2
is activated by default since Solidity v0.8. - Fix outdated struct initialization in contracts/GovernorBravoDelegate.sol L129. This is similar to the latest Compound implementation in contracts/Governance/GovernorBravoDelegate L95, since Solidity disallows structs and arrays in memory or calldata if they contain nested mappings since v0.7.
- Use
view
modifier forgetChainId(...)
andgetChainIdInternal(...)
functions instead ofpure
. - Remove superfluous
public
visibility tags from constructors. - Remove superfluous
SafeMath.sol
and refactor all affected lines to use standard Solidity arithmatic operations instead, since Solidity checks arithmatic operations by default since v0.8. - Use
type(uint256).max
instead of deprecateduint256(-1)
. - Use
type(uint96).max
instead of deprecateduint96(-1)
. - Use
block.timestamp
instead of deprecatednow
.
- Removed superfluous
ddded2ac84fdcee3e90a3dbcb3ca9a395b365cdd
- Added Ampleforth token burn functionality to Hifi token by forking code directly from ampleforth/Forth/contracts/Forth.sol L134.
29b9886ee7ba140f21029d8d2355bbca016e7445
-
Removed Uniswap emission schedule from Hifi token, which included the following changes:
- Removed
mintingAllowedAfter
storage var. - Removed
minimumTimeBetweenMints
constant. - Removed
mintCap
constant. - Remove any require statements that depend on any removed variables.
- Refactor
mint(...)
function implementation.
Note: this commit includes a bug at hifi-finance/hifi-governance/contracts/Hifi.sol L119 that was fixed later on in 2f2bdf95b3bdeeeadb8bac01837847de689a6c43.
- Removed
3c6c3a51c4a4c7d3707389a3eec2f639d4489ce6
- Completely removed
SafeMath.sol
file and replace SafeMath operations insideTimelock.sol
with standard Solidity arithmatic operations.
2f2bdf95b3bdeeeadb8bac01837847de689a6c43
- Fixes a bug that was introduced at hifi-finance/hifi-governance/contracts/Hifi.sol L119.
e1dc7ddb22cf0b2944fbf5a8ce462dc1f7a1e91f
- Add the MFT to HIFI token swap functionality. The code for the
swap(...)
function was not forked.
8910f813f1101170b2ab43dc9041afacc193f9c8
- Refactored the MFT to HIFI token swap functionality.
c235e08f23e2c735966768752e1b84ffcc3fc249
- Fixed bug in
swap(...)
at hifi-finance/hifi-governance/contracts/Hifi.sol L396 caused by trying to send burned MFT tokens toaddress(0)
, which is not allowed in the MFT token contract implementation.
12ff0b4014b80f538dc640df6a084ea92c0d5acd
- Added a gas optimization at hifi-finance/hifi-governance/contracts/GovernorBravoDelegate.sol L127 by avoiding multiple SLOAD operations.