Commit Graph

65 Commits

Author SHA1 Message Date
0xb337r007 4f302418b2 chore(Vault): test withdrawUntrackedERC20 2024-03-11 13:46:36 +01:00
0xb337r007 b75bae294e feat(Vault): allow withdrawal of untracked tokens 2024-03-07 17:53:05 +01:00
0xb337r007 34219eb14f feat(CommunityVault): add erc721 deposit function 2024-03-04 13:18:16 +01:00
0xb337r007 6213e992d1 feat(CommunityVault): add erc20 deposit function 2024-03-04 13:18:16 +01:00
r4bbit a2cf75787f chore: cut 1.0.0 release 2024-02-28 12:00:12 +01:00
r4bbit 652787cfe7 chore: add commit-and-tag-version package 2024-02-28 11:45:09 +01:00
r4bbit b2b25ff6e3 chore(OwnerToken): remove unused `CommunityOwnable` import
This seems to have been a leftover.
2024-02-28 11:44:52 +01:00
r4bbit fcf30cde8f refactor(OwnerToken)!: use custom error in `setMaxSupply`
This changes the usage of a string error message to a custom error for
slight gas improvements.

BREAKING CHANGE:

`OwnerToken.setMaxSupply(uint256)` now emits
`OwnerToken.OwnerToken_MaxSupplyLocked.selector` instead of `"max supply
locked"`
2024-02-28 11:44:39 +01:00
r4bbit a84c46b3d6 refactor!: rename `CollectibleV1`to `CommunityERC721`
As discussed in #46, `CollectibleV1` is not a good name for this
contract as we don't want versioning in the naming. To align with other
contracts in this repository, we're renaming this contract to
`CommunityERC721`.

BREAKING CHANGE: Any references to `CollectibleV1` must be replaced with
`CommunityERC721`

Closes #46
2024-02-27 11:44:06 +01:00
r4bbit 023e43f4ad chore(certora/scripts): remove wait for all results option 2024-02-26 14:24:56 +01:00
r4bbit c7f800fd85 cleanup: remove unused certora config
We're using scripts in `certora/scripts`, so I'm removing the config
file from here as we otherwise run into inconsistencies.
2024-02-26 14:11:18 +01:00
r4bbit 9d445f2b75 docs(README): add optimism sepolia addresses 2024-02-26 14:00:34 +01:00
r4bbit 4825d291df cleanup(BaseToken): remove unused import 2024-02-26 13:48:36 +01:00
r4bbit a8e509baf7 feat(CollectibleV1): add `safeBatchTransferFrom` capabilities
This is to allow batch transfers of community collectibles as discussed
in #41.

Closes #41, #42, #43, #44
2024-02-26 13:48:36 +01:00
r4bbit d02d6f7ea8 ci(workflows): only add opened PRs to project board
Otherwise the automation will signal failure every time one pushes into
an existing PR.
2024-02-22 12:10:20 +01:00
0xb337r007 66ba281c75
fix setMaxSupply to check total minted (#27) 2024-02-22 11:44:48 +01:00
r4bbit 986bbaab00 chore(workflows): add automation to add PRs to review to project board 2024-02-15 15:05:27 +01:00
r4bbit 4b66dece17 chore(workflow): add workflow to auto-add issues to project 2024-02-15 11:50:39 +01:00
r4bbit 0c9ba521a0 docs(PROPERTIES): add property descriptions to `PROPERTIES.md`
Closes #9
2024-01-19 07:28:25 +01:00
r4bbit e3142f1e52 refactor: move certora configs into individual scripts
This is done to allow execution of multiple verifications per command,
such that we can still use `pnpm verify` as usual to run all specs, but
also target individual specs using `pnpm verify:sub_command`.
2024-01-19 07:28:25 +01:00
r4bbit 847cbb9107 chore: introduce certora specs for CommunityTokenDeployer
This adds some basic specs for the `CommunityTokenDeployer` and its
interaction with `CommunityOwnerTokenRegistry`.
2024-01-19 07:28:25 +01:00
r4bbit aa3f26ee80
docs(README): add production deployment addresses (#25)
Also adjust etherscan config for arbitrum, as `arbitrume_one` is falsy.
Foundry only knows `arbitrum`.
2023-12-18 12:03:59 +01:00
r4bbit 8773220abe
feat: add certora CI integration (#24)
This backports Certora CI integration to this repository, resulting in
GitHub Actions being extended to run formal verification on any change
to contracts that comes in via pull requests.
2023-12-14 08:53:57 +01:00
0xb337r007 6f83e7346c
add CommunityVault contract (#22)
* add CommunityVault contract

* use named import

* test vault transfer functions for erc20 and erc721

* fix camel case test name

* update format with latest version of forge
2023-12-12 23:10:27 +01:00
r4bbit d86381ffd1
chore: add goerli deployment addresses (#23)
* chore: add goerli deployment addresses

Redeployed on goerli for latest version

* chore: add arbitrum goerli deployment addresses

* chore: add arbitrum sepolia deployment addresses
2023-11-20 15:58:59 +01:00
Cuteivist 1085ee8308
feat: Add base url to community ERC20 (#21) 2023-10-18 12:12:29 +02:00
r4bbit 21977b99f6
docs(README): add Sepolia deployment addresses (#20) 2023-10-11 15:38:30 +02:00
r4bbit ea7ef0ef61
feat: introduce custom `StatusMint()` events (#18) 2023-10-06 10:21:27 +02:00
0xb337r007 ff01f8e818
add master/owner tokens to erc20 token (#19) 2023-10-06 09:21:03 +02:00
r4bbit ff7de4a819
refactor: use named imports (#17) 2023-10-03 09:06:10 +02:00
r4bbit f00912276a
docs: add deployment addresses for optimism goerli to readme (#16) 2023-09-22 15:13:48 +02:00
r4bbit e7d799b761
refactor: use immutable properties where possible (#5)
This commit changes a few token properties to be `immutable` as this
reduces gas costs even further.

This was reported by Slither.

A gas report with changes in gas cost is attached.
2023-09-22 12:32:38 +02:00
r4bbit 8f633ee442
refactor: use `Ownable2Step` instead of `Ownable` (#10)
This has been discussed in #7 and be further explored in https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3620

Closes #7
2023-09-22 12:23:00 +02:00
r4bbit 16121a4f72
feat: add token specific deploy events in deployer contract (#14)
While the underlying factories emit a `CreateToken` event, there was a
request to have specific deployment events for each token emitted by the
deployer.
2023-09-22 12:11:16 +02:00
r4bbit 5772805ad7
refactor: don't revert deployment on non-existant configs (#15)
At this point, the contracts that need to be deployed do not require
chain specific configurations. The ones provided for local test nodes
are used in tests that don't represent the production deployment.

Hence, there's little point in reverting the deployment if there's no
config for a specific chain.

This commit also moves the `deployer` assignment to the beginning of the
constructor, ensuring that it's set when configs are created.
2023-09-22 12:10:48 +02:00
r4bbit 69e0e5eeaf
refactor: introduce custom errors for better gas costs (#3)
This commit introduces custom errors for `BaseToken` and
`CommunityERC20` to reduce the gas costs in revert cases. Using
`require()` with a string error message requires every character of the
message to be store in memory which costs more gas than a fixed sized
error selector. Hence, it's recommended to use custom errors instead.

A gas snapshot is attached in this commit to show the improved gas
costs.
2023-09-20 07:30:25 +02:00
r4bbit c22096b779
docs: fix readme image path (#12) 2023-09-19 18:50:24 +02:00
r4bbit 253394157c
docs: add documentation about communities contracts (#4) 2023-09-19 16:23:03 +02:00
r4bbit 103a374cac
docs: fix gha-badge (#11)
* docs: fix gha-badge

* docs: add codecov badge
2023-09-19 12:04:13 +02:00
r4bbit 4be8613d6e
feat: implement `CommunityTokenDeployer` contract (#2)
This commit introduces the `CommunityTokenDeployer` contract discussed
in https://github.com/status-im/status-desktop/issues/11954.

The idea is that, instead of having accounts deploy `OwnerToken` and
`MasterToken` directly, they'd use a deployer contract instead, which
maintains a registry of known `OwnerToken` addresses, mapped to Status
community addresses.

The following changes have been made:

It was, and still is, a requirement that both, `OwnerToken` and
`MasterToken` are deployed within a single transaction, so that when
something goes wrong, we don't end up in an inconsistent state.

That's why `OwnerToken` used to instantiated `MasterToken` and required
all of its constructor arguments as well.

Unfortunately, this resulted in compilation issues in the context of the
newly introduce deployer contract, where there are too many function
arguments.

Because we now delegate deployment to a dedicated contract, we can
instantiate both `OwnerToken` and `MasterToken` in a single transaction,
without having `OwnerToken` being responsible to instantiate
`MasterToken`.

This fixes the compilation issues and simplifies the constructor of
`OwnerToken`.

The new `CommunityTokenDeployer` contract is now responsble for
deploying the aforementioned tokens and ensures that they are deployed
within a single transaction.

To deploy an `OwnerToken` and `MasterToken` accounts can now call
`CommunityDeloyerToken.deploy(TokenConfig, TokenConfig,
DeploymentSignature)`.

The `DeploymentSignature` uses `EIP712` structured type hash data to let
the contract verify that the deployer is allowed to deploy the contracts
on behalf of a community account.
2023-09-19 11:39:55 +02:00
Andrea Franz e52eff0254
Merge pull request #6 from status-im/refactor/foundry-template
refactor: move project to foundry template and introduce tests
2023-09-19 10:12:24 +02:00
r4bbit c2f500c2e5
refactor: move project to foundry template and introduce tests
This commit does a couple of things:

- moves the project to our foundry template structure and workflows
- removes hardhat usage and dependencies
- removes unused contracts
- ports existing JS tests to foundry tests
- adds additional tests for `CommunityERC20` contract
- Introduces deploy scripts written in solidity which are also covered
  by tests

The projects can now be build and tests with:

```
$ forge build
```

```
$ forge test
```

Test deployments can be done via

```
$ forge script script/DeployOwnerToken.sol
```
2023-09-08 12:36:20 +02:00
r4bbit b112414fae
chore: trigger CI on pull request 2023-08-30 11:33:27 +02:00
r4bbit ab92006c26
Set up initial CI actions 2023-08-30 11:24:52 +02:00
0xb337r007 8d3f185bf4 update deploy script 2023-08-10 09:16:42 +02:00
0xb337r007 9c2d8527a1 mint Owner token in constructor 2023-08-10 09:10:17 +02:00
0xb337r007 dd24b30d89 add deploy script for OwnerToken 2023-07-21 10:04:02 +02:00
0xb337r007 14c9b0b627 rename setSignerPublicKey 2023-07-14 15:30:22 +02:00
0xb337r007 7a365b1be3 add signer public key to OwnerToken 2023-07-14 15:12:03 +02:00
0xb337r007 9110e8fc13 add MasterTokenCreated event 2023-07-14 15:07:04 +02:00