Skip to content

Commit

Permalink
Merge pull request #33 from 0xPolygon/sec/audit
Browse files Browse the repository at this point in the history
Audit Reports
  • Loading branch information
oneski authored Oct 5, 2023
2 parents a780764 + 9287331 commit 37726c3
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 9 deletions.
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ A default implementation is included and this contract will be proxy upgradable

[Source Code](https://github.com/0xPolygon/pol-token/tree/main/src/DefaultEmissionManager.sol)

## Development

### Setup

- [Install foundry](https://book.getfoundry.sh/getting-started/installation)
- Install Dependencies: `forge install`
- Build: `forge build`
- Test: `forge test`

### Deployment

1. Ensure .env file is set, `cp .env.example`
2. Populate Enviornment variables: `source .env`
3. We use a forge script to deploy the contracts, and have an additional extract.js script to store a JSON file with coalesced deployment information. (see [output](./output/))

- (mainnet): `forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --etherscan-api-key $ETHERSCAN_API_KEY`
- (testnet, goerli for example): `forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --verifier-url https://api-goerli.etherscan.io/api --chain-id 5`

4. Run `node script/util/extract.js <chainId>` to extract deployment information from forge broadcast output (broadcast/latest-run.json).

---

Copyright (C) 2023 PT Services DMCC
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DefaultEmissionManager
[Git Source](https://github.com/0xPolygon/pol-token/blob/c05c8984ac856501829862c1f6d199208aa77a8e/src/DefaultEmissionManager.sol)
[Git Source](https://github.com/0xPolygon/pol-token/blob/a780764684dd1ef1ca70707f8069da35cddbd074/src/DefaultEmissionManager.sol)

**Inherits:**
Ownable2StepUpgradeable, [IDefaultEmissionManager](/src/interfaces/IDefaultEmissionManager.sol/interface.IDefaultEmissionManager.md)
Expand Down Expand Up @@ -76,7 +76,7 @@ See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps*


```solidity
uint256[50] private __gap;
uint256[48] private __gap;
```


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PolygonEcosystemToken
[Git Source](https://github.com/0xPolygon/pol-token/blob/c05c8984ac856501829862c1f6d199208aa77a8e/src/PolygonEcosystemToken.sol)
[Git Source](https://github.com/0xPolygon/pol-token/blob/a780764684dd1ef1ca70707f8069da35cddbd074/src/PolygonEcosystemToken.sol)

**Inherits:**
ERC20Permit, AccessControlEnumerable, [IPolygonEcosystemToken](/src/interfaces/IPolygonEcosystemToken.sol/interface.IPolygonEcosystemToken.md)
Expand Down Expand Up @@ -129,6 +129,24 @@ The permit2 contract has full approval by default. If the approval is revoked, i
function allowance(address owner, address spender) public view override(ERC20, IERC20) returns (uint256);
```

### getVersion

Returns the implementation version

*This is to support our dev pipeline, and is present despite
this contract not being behind a proxy*


```solidity
function getVersion() external pure returns (string memory);
```
**Returns**

|Name|Type|Description|
|----|----|-----------|
|`<none>`|`string`|Version string|


### _updatePermit2Allowance


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PolygonMigration
[Git Source](https://github.com/0xPolygon/pol-token/blob/c05c8984ac856501829862c1f6d199208aa77a8e/src/PolygonMigration.sol)
[Git Source](https://github.com/0xPolygon/pol-token/blob/a780764684dd1ef1ca70707f8069da35cddbd074/src/PolygonMigration.sol)

**Inherits:**
Ownable2StepUpgradeable, [IPolygonMigration](/src/interfaces/IPolygonMigration.sol/interface.IPolygonMigration.md)
Expand Down Expand Up @@ -41,7 +41,7 @@ See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps*


```solidity
uint256[50] private __gap;
uint256[49] private __gap;
```


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IDefaultEmissionManager
[Git Source](https://github.com/0xPolygon/pol-token/blob/c05c8984ac856501829862c1f6d199208aa77a8e/src/interfaces/IDefaultEmissionManager.sol)
[Git Source](https://github.com/0xPolygon/pol-token/blob/a780764684dd1ef1ca70707f8069da35cddbd074/src/interfaces/IDefaultEmissionManager.sol)


## Functions
Expand All @@ -10,6 +10,13 @@
function getVersion() external pure returns (string memory version);
```

### token


```solidity
function token() external view returns (IPolygonEcosystemToken polygonEcosystemToken);
```

### startTimestamp


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IPolygonEcosystemToken
[Git Source](https://github.com/0xPolygon/pol-token/blob/c05c8984ac856501829862c1f6d199208aa77a8e/src/interfaces/IPolygonEcosystemToken.sol)
[Git Source](https://github.com/0xPolygon/pol-token/blob/a780764684dd1ef1ca70707f8069da35cddbd074/src/interfaces/IPolygonEcosystemToken.sol)

**Inherits:**
IERC20, IERC20Permit, IAccessControlEnumerable
Expand All @@ -13,6 +13,13 @@ IERC20, IERC20Permit, IAccessControlEnumerable
function mintPerSecondCap() external view returns (uint256 currentMintPerSecondCap);
```

### getVersion


```solidity
function getVersion() external pure returns (string memory version);
```

### lastMint


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IPolygonMigration
[Git Source](https://github.com/0xPolygon/pol-token/blob/c05c8984ac856501829862c1f6d199208aa77a8e/src/interfaces/IPolygonMigration.sol)
[Git Source](https://github.com/0xPolygon/pol-token/blob/a780764684dd1ef1ca70707f8069da35cddbd074/src/interfaces/IPolygonMigration.sol)


## Functions
Expand All @@ -10,6 +10,13 @@
function unmigrationLocked() external view returns (bool isUnmigrationLocked);
```

### polygon


```solidity
function polygon() external view returns (IERC20 polygonEcosystemToken);
```

### getVersion


Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/lib/PowUtil.sol/library.PowUtil.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PowUtil
[Git Source](https://github.com/0xPolygon/pol-token/blob/c05c8984ac856501829862c1f6d199208aa77a8e/src/lib/PowUtil.sol)
[Git Source](https://github.com/0xPolygon/pol-token/blob/a780764684dd1ef1ca70707f8069da35cddbd074/src/lib/PowUtil.sol)


## Functions
Expand Down

0 comments on commit 37726c3

Please sign in to comment.