Skip to content

Commit

Permalink
fix(scripts): MAPP-203: Refactor and add missing deployment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
buildwithme committed Mar 29, 2024
1 parent fba76ea commit ce2a38f
Show file tree
Hide file tree
Showing 36 changed files with 2,805 additions and 361 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ out/

# Ignore Environment Variables!
.env
.env.prod
.env.*

# IDEs (JetBrains and VSCode)
.idea/
.vscode/
.history/

# Ignore flattened files
flattened.txt
Expand Down
8 changes: 8 additions & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": [
"development"
],
"hints": {
"typescript-config/consistent-casing": "off"
}
}
2 changes: 1 addition & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "solhint:default",
"rules": {
"max-line-length": ["error", 140],
"max-line-length": ["error", 140],
"func-name-mixedcase": "off"
}
}
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ For more details about the internal architecture of the repository, see [CONTRIB

## Governance

- there is no onchain governance for now

### Maintainers

- Mathieu Bour <[mathieu.bour@pooky.gg](mailto:mathieu.bour@pooky.gg)>, Blockchain Engineer, Pooky Labs
- Claudiu Micu <[claudiu.micu@pooky.gg](mailto:claudiu.micu@pooky.gg)>, Software Engineer, Pooky Labs

### Contributors

- Claudiu Micu <[claudiu.micu@pooky.gg](mailto:claudiu.micu@pooky.gg)>, Software Engineer, Pooky Labs
- Mathieu Bour <[mathieu.bour@pooky.gg](mailto:mathieu.bour@pooky.gg)>, Blockchain Engineer, Pooky Labs
- Dusan Zdravkovic <[[email protected]](mailto:[email protected])>, Former Blockchain Engineer, Pooky Labs

### On-chain maintenance
Expand All @@ -45,11 +47,3 @@ We mainly use the following permission contracts:
- [solady/auth/Ownable.sol](https://github.com/Vectorized/solady/blob/main/src/auth/Ownable.sol)
- [solady/auth/OwnableRoles.sol](https://github.com/Vectorized/solady/blob/main/src/auth/OwnableRoles.sol)
- [openzeppelin/access/IAccessControl.sol](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/17c1a3a4584e2cbbca4131f2f1d16168c92f2310/contracts/access/AccessControl.sol)

The administrative privilege of granting/revoking roles is handled by a multi-signature wallet owned by multiple
engineers of Pooky Labs.
The address of the current multi-signature admin wallet is [`0x3CC4F4372F83ad3C577eD6e1Aae3D244A1b955D5`](https://polygonscan.com/address/0x3CC4F4372F83ad3C577eD6e1Aae3D244A1b955D5).

The Pooky dApp [pooky.gg](https://pooky.gg/app) serves as reference to the "official" Pooky smart contracts, effectively serving as smart-contracts proxy.
Pooky Labs may switch the contract implementations at any time on the app.
In this scenario of a token upgrades, Pooky Labs commits to airdrop the tokens to their owners in the new implementation.
8 changes: 8 additions & 0 deletions docs/chains/amoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Chain info:

- Network Name: `Polygon Amoy Testnet`
- New RPC URL: [`https://80002.rpc.thirdweb.com`](https://80002.rpc.thirdweb.com)
- Chain ID: `80002`
- Currency Symbol: `MATIC`
- Block Explorer URL: [`https://www.oklink.com/amoy`](https://www.oklink.com/amoy)
- Faucet: [`https://faucet.polygon.technology/`](https://faucet.polygon.technology/)
8 changes: 8 additions & 0 deletions docs/chains/mainnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Chain info:

- Network Name: `Polygon Mainnet`
- New RPC URL: [`https://polygon-rpc.com`](https://polygon-rpc.com)
- Chain ID: `137`
- Currency Symbol: `MATIC`
- Block Explorer URL: [`https://polygonscan.com`](https://polygonscan.com)
- Faucet: [`https://faucet.polygon.technology/`](https://faucet.polygon.technology/)
14 changes: 7 additions & 7 deletions docs/stickers.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Please refer to the [Pooky whitepaper](https://whitepaper.pooky.gg/stickers) for

## Contracts list

### [`Stickers.sol`](../src/tokens/Stickers.sol)
### [`Stickers.sol`](../src/stickers/Stickers.sol)

Stickers smart contract follows the ERC-721 specification and take advantage of the [ERC721A implementation](https://github.com/chiru-labs/ERC721A#readme).
ERC721A allows to save hug amounts of gas when minting multiple stickers at the same time.

The Stickers contract is based on our [`BaseERC721A.sol`](../src/base/BaseERC721A.sol) contract that implements:
The Stickers contract is based on our [`BaseERC721A.sol`](../src/common/BaseERC721A.sol) contract that implements:

- ERC721 NFT standard
- ERC2891 royalties standard
Expand All @@ -22,7 +22,7 @@ The Stickers contract is based on our [`BaseERC721A.sol`](../src/base/BaseERC721
Minting stickers is only possible via the `mint` function.
This function will automatically call the Chainlink VRF cooridinator and request the seeds for the newly minted Stickers.

### [`StickersController.sol`](../src/game/StickersController.sol)
### [`StickersController.sol`](../src/stickers/StickersController.sol)

The `StickersController` is in charge of the Pookyballs <=> Stickers association.
It is not supposed to run any check if a Sticker can be attached to a Pookyball or not.
Expand All @@ -49,7 +49,7 @@ To ensure that:

Attaching a Sticker to a Pookyball transfers the Stickers from the sender inventory to the `StickersController` itself.

### [`StickersManager.sol`](../src/game/StickersManager.sol)
### [`StickersManager.sol`](../src/stickers/StickersManager.sol)

`StickersManager` can be seen at the Stickers game implementation that uses the `StickersController` primitives.
It is likely to be replaced in the future by a new contract that will implement new rules.
Expand All @@ -59,10 +59,10 @@ Currently, the `StickersManager`:
- controls how much slots are available on Pookyballs depending on their level and rarities (`StickersManager.slots`)
- ensure that a sticker can be attach to a Pookyball only if the Pookyball has a free slot slot

### [`StickersLevelUp.sol`](../src/game/StickersLevelUp.sol)
### [`StickersLevelUp.sol`](../src/stickers/StickersLevelUp.sol)

Stickers can be leveled up using the `StickersLevelUp` contract.
`StickersLevelUp` is based on our [`LevelUpContract`](../src/base/LevelUp.sol).
`StickersLevelUp` is based on our [`LevelUpContract`](../src/common/LevelUp.sol).

Since the we don't store the Stickers PXP on chain to save gas, users will have to query the back-end to get a signature that certify the PXP amount they pass to the `levelUp` function.

Expand All @@ -72,6 +72,6 @@ function levelUp(uint256 tokenId, uint256 increase, uint256 currentPXP, bytes ca

Applications may listen to the `LevelChanged` event of the `Stickers` contract to follow the changes of the Stickers levels.

### [`StickersSale.sol`](../src/mint/StickersSale.sol)
### [`StickersSale.sol`](../src/stickers/StickersSale.sol)

The Stickers can be minted in batch via the `StickersSale` contract.
32 changes: 32 additions & 0 deletions docs/wallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Production environment

The administrative privilege of granting/revoking roles is handled by a multi-signature wallet owned by multiple engineers of Pooky Labs.

- polygon scan address [`0x3CC4F4372F83ad3C577eD6e1Aae3D244A1b955D5`](https://polygonscan.com/address/0x3CC4F4372F83ad3C577eD6e1Aae3D244A1b955D5).

- safe wallet URL is [`https://app.safe.global/home?safe=matic:0x3CC4F4372F83ad3C577eD6e1Aae3D244A1b955D5`](https://app.safe.global/home?safe=matic:0x3CC4F4372F83ad3C577eD6e1Aae3D244A1b955D5)

The Pooky dApp [pooky.gg](https://pooky.gg/app) serves as reference to the "official" Pooky smart contracts
Pooky Labs may switch to other smart contract at any time on the app.
In this scenario, Pooky Labs commits to airdrop the tokens to their owners in the new smart contracts.

# Wallets

- deployer - is the address from which all smart contracts are deployed
- admin - is the owner of each smart contract
- backend - is another wallet that is used to sign backend payloads
- treasury - is the wallet where the funds are stored on each network

## Wallets Polygon mainnet network

- Deployer - [`0xC0DE54132cA2B4BAce7C02AF31Aa9d3c1905f379`](https://polygonscan.com/address/0xC0DE54132cA2B4BAce7C02AF31Aa9d3c1905f379).
- Admin - [`0xF00Db2f08D1F6b3f6089573085B5826Bb358e319`](https://polygonscan.com/address/0xF00Db2f08D1F6b3f6089573085B5826Bb358e319).
- Backend - [`0xCAFE3e690bf74Ec274210E1c448130c1f8228513`](https://polygonscan.com/address/0xCAFE3e690bf74Ec274210E1c448130c1f8228513).
- Treasury - [`0xBABA035d2e22073C3a2AadA404dae4f6A9D57BD7`](https://polygonscan.com/address/0xBABA035d2e22073C3a2AadA404dae4f6A9D57BD7).

## Wallets Polygon mainnet network

- Deployer - [`0xC0DE54132cA2B4BAce7C02AF31Aa9d3c1905f379`](https://www.oklink.com/amoy/address/0xC0DE54132cA2B4BAce7C02AF31Aa9d3c1905f379).
- Admin - [`0xF00Db2f08D1F6b3f6089573085B5826Bb358e319`](https://www.oklink.com/amoy/address/0xF00Db2f08D1F6b3f6089573085B5826Bb358e319).
- Backend - [`0xCAFE3e690bf74Ec274210E1c448130c1f8228513`](https://www.oklink.com/amoy/address/0xCAFE3e690bf74Ec274210E1c448130c1f8228513).
- Treasury - [`0xBABA035d2e22073C3a2AadA404dae4f6A9D57BD7`](https://www.oklink.com/amoy/address/0xBABA035d2e22073C3a2AadA404dae4f6A9D57BD7).
36 changes: 28 additions & 8 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
# Foundry config reference: https://github.com/foundry-rs/foundry/tree/master/config
[profile.default]
src = "src"
out = "artifacts"
libs = ["lib"]
solc = "0.8.22"
evm_version = "paris"
bytecode_hash = "none"
cbor_metadata = false
evm_version = "paris"
fs_permissions = [{ access = "read", path = "./test/datasets" }]
libs = ["lib"]
optimizer = true
optimizer_runs = 200
out = "artifacts"
solc = "0.8.22"
src = "src"
remappings = [
'ERC721A/=lib/ERC721A/contracts/',
'chainlink/=lib/chainlink/contracts/src/v0.8/',
'ds-test/=lib/forge-std/lib/ds-test/src/',
'erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/',
'forge-std/=lib/forge-std/src/',
'openzeppelin-contracts/=lib/openzeppelin-contracts/',
'openzeppelin/=lib/openzeppelin-contracts/contracts/',
'operator-filter-registry/=lib/operator-filter-registry/src/',
'solady/=lib/solady/src/',
'@/=src/',
'@test/=test/',
'@script/=script/',
]

[profile.default.fuzz]
runs = 256
Expand All @@ -16,14 +32,18 @@ runs = 256
runs = 5_000

[rpc_endpoints]
amoy = "${AMOY_RPC_URL}"
polygon = "${POLYGON_RPC_URL}"
mumbai = "${MUMBAI_RPC_URL}"

[etherscan]
amoy = { key = "${POLYGONSCAN_API_KEY}" }
polygon = { key = "${POLYGONSCAN_API_KEY}" }
mumbai = { key = "${POLYGONSCAN_API_KEY}" }

[fmt]
bracket_spacing = true
line_length = 100
tab_width = 2
bracket_spacing = true

[profile.ci]
verbosity = 4

Loading

0 comments on commit ce2a38f

Please sign in to comment.