Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix lint #32

Merged
merged 3 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
{
"printWidth": 120,
"tabWidth": 4,
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
"bracketSpacing": true,
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
}
]
}
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,23 @@ A default implementation is included and this contract will be proxy upgradable

## Development

# Setup
### Setup

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

# Deployment
### 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
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` to extract deployment information from forge broadcast output (broadcast/latest-run.json specifically).
4. Run `node script/util/extract.js <chainId>` to extract deployment information from forge broadcast output (broadcast/latest-run.json).

---

Expand Down
11 changes: 6 additions & 5 deletions script/utils/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ async function main() {
deployments
.filter(
({ contractName }) =>
contractName !== "TransparentUpgradeableProxy" &&
!proxies.find((p) => p.contractName === contractName)
contractName !== "TransparentUpgradeableProxy" && !proxies.find((p) => p.contractName === contractName)
)
.map(async ({ contractName, contractAddress, transaction: { data } }) => ({
address: contractAddress,
Expand Down Expand Up @@ -70,8 +69,10 @@ async function main() {
}
// overwrite latest with changed contracts
out.latest = {
...out.latest,
contracts,
contracts: {
...out.latest?.contracts,
...contracts,
},
input: config[chainId],
commitHash,
timestamp: data.timestamp,
Expand Down Expand Up @@ -106,7 +107,7 @@ async function getVersion(contractAddress, rpcUrl) {
if (res.error) throw new Error(res.error.message);
return { version: hexToAscii(res.result)?.trim() || res.result };
} catch (e) {
if (e.message === "execution reverted") return null; // contract does implement getVersion()
if (e.message === "execution reverted") return null; // contract does not implement getVersion()
console.log("getVersion error:", rpcUrl, e.message);
return { version: undefined };
}
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IPolygonEcosystemToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface IPolygonEcosystemToken is IERC20, IERC20Permit, IAccessControlEnumerab
error MaxMintExceeded(uint256 maxMint, uint256 mintRequested);

function mintPerSecondCap() external view returns (uint256 currentMintPerSecondCap);

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

function lastMint() external view returns (uint256 lastMintTimestamp);
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IPolygonMigration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface IPolygonMigration {

function unmigrationLocked() external view returns (bool isUnmigrationLocked);

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

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

Expand Down
Loading