[UNI] ERC20 Token Smart Contract Domain Community Assessment
General Information
- Symbol: UNI
- Address: 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
- Deployment Date: September 14, 2020
- Total supply: 1,000,000,000 UNI
- Developers allotment: 212,660,000 UNI (21.266% to team members and future employees with 4-year vesting)
- Project website: https://uniswap.org
- Github repository: https://github.com/Uniswap/governance
- Can use existing MCD collateral type adapter? Yes, GemJoin
Risk Summary
-
Does the contract implement the ERC20 token standards?
Yes, the contract implements all the required ERC20 functions. - Risk analysis: LOW
Technical Information
- Compiler version: v0.5.16+commit.9c3226ce
- Decimals: 18
- Overflow checks: Yes, the contract has custom safe Integer and add functions
- Mitigation against allowance race-condition: No, the approve function has a race condition
- Upgradeable contract patterns: No
- Access control or restriction lists: Minter access to setMinter and mint functions
- Non-standard features or behaviors: permit, minting, voting, and vote delegation related functions
Formal Verification Considerations:
- Does transfer have simple semantics? Yes
- Does transferFrom have simple semantics? Yes
- Can balances be arbitrarily modified by some actor? No
- Are there any external calls? No
Testnet Information
Ropsten: 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984
Rinkeby: 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984
Görli: 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984
Kovan: 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984
UNI networks deployment information: https://uniswap.org/docs/v2/governance/overview/
Contract Logic Summary
At its core the implementation is a standard erc20 contract which uses the custom safe integer and add functions.
The contract also implements mint functions which use a custom SafeMath Library derived form Math (OpenZeppelin), permit function and various voting, and vote delegation functions.
Administrative Addresses
Below is a list of addresses related to token management:
delegation typehash: 0xe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf
domain typehash: 0x8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866
permit typehash: 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9
Contract Risk Summary
This is a low risk contract. The ERC20 functions are implemented to the industry standard, although approve does have a race condition. The contract makes use of custom functions to prevent integer underflow and overflow. A number of voting functions are also implemented as UNI is a governance token.
Supporting Materials
Tests
Architecture Diagram
Inheritance Diagram
Sūrya’s Description Report
Files Description Table
File Name | SHA-1 Hash |
---|---|
uni.sol | 46e82a5db81f02d25309cbb6197827064d11c265 |
Contracts Description Table
Contract | Type | Bases | ||
---|---|---|---|---|
L | Function Name | Visibility | Mutability | Modifiers |
SafeMath | Implementation | |||
L | add | Internal ![]() |
![]() |
|
L | add | Internal ![]() |
![]() |
|
L | sub | Internal ![]() |
![]() |
|
L | sub | Internal ![]() |
![]() |
|
L | mul | Internal ![]() |
![]() |
|
L | mul | Internal ![]() |
![]() |
|
L | div | Internal ![]() |
![]() |
|
L | div | Internal ![]() |
![]() |
|
L | mod | Internal ![]() |
![]() |
|
L | mod | Internal ![]() |
![]() |
|
Uni | Implementation | |||
L | Public ![]() |
![]() |
![]() |
|
L | setMinter | External ![]() |
![]() |
![]() |
L | mint | External ![]() |
![]() |
![]() |
L | allowance | External ![]() |
![]() |
|
L | approve | External ![]() |
![]() |
|
L | permit | External ![]() |
![]() |
![]() |
L | balanceOf | External ![]() |
![]() |
|
L | transfer | External ![]() |
![]() |
![]() |
L | transferFrom | External ![]() |
![]() |
![]() |
L | delegate | Public ![]() |
![]() |
![]() |
L | delegateBySig | Public ![]() |
![]() |
![]() |
L | getCurrentVotes | External ![]() |
![]() |
|
L | getPriorVotes | External ![]() |
![]() |
|
L | _delegate | Internal ![]() |
![]() |
|
L | _transferTokens | Internal ![]() |
![]() |
|
L | _moveDelegate | Internal ![]() |
![]() |
|
L | _writeCheckpoint | Internal ![]() |
![]() |
|
L | safe32 | Internal ![]() |
||
L | safe96 | Internal ![]() |
||
L | add96 | Internal ![]() |
||
L | sub96 | Internal ![]() |
||
L | getChainId | Internal ![]() |
Legend
Symbol Meaning
Function can modify state
Function is payable