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

AB Platform v1.1 upgrade #18

Merged
merged 61 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
cd038b5
init draft
0xPilou Sep 12, 2023
f1e0642
updated getPayoutDetails
0xPilou Sep 19, 2023
c281abd
cache
0xPilou Sep 19, 2023
09dd824
remove unused imports
0xPilou Sep 21, 2023
a36a005
updated withdraw to rightholder args
0xPilou Sep 21, 2023
7daab67
cache
0xPilou Sep 21, 2023
ad04197
added setDropFee function
0xPilou Sep 21, 2023
afa707e
cache
0xPilou Sep 21, 2023
ed74d3a
disable solhint in tests scripts
0xPilou Sep 21, 2023
94509de
disable solhint in tests scripts
0xPilou Sep 21, 2023
b927456
added coverage for drop specific fees
0xPilou Sep 21, 2023
7c4cdb6
increased coverage withdrawRightholder
0xPilou Sep 21, 2023
bcfdaff
dataregistry lcov
0xPilou Sep 21, 2023
41680d9
updated getPayoutDetails coverage
0xPilou Sep 22, 2023
4688930
added collaboration workflow to README
0xPilou Sep 22, 2023
f272289
draft ERC721AB OpenEdition contract
0xPilou Sep 26, 2023
2a995b2
added test coverage for ERC721AB OpenEdition
0xPilou Sep 27, 2023
c779b5e
fix typo
0xPilou Sep 27, 2023
80e9c33
migrate ERC721AB to abstract contract
0xPilou Sep 28, 2023
3292517
draft limited edition contract (ex-ERC721AB)
0xPilou Sep 28, 2023
dfc76dc
Merge pull request #13 from Anotherblock/ab456-dropIdFee
0xPilou Sep 28, 2023
e800b95
Merge branch 'dev' into ab558-standardNFT
0xPilou Sep 28, 2023
9b5bebb
remove unnecessary imports
0xPilou Sep 28, 2023
51791e0
updated deploy scripts
0xPilou Sep 28, 2023
b39838c
rename test data
0xPilou Sep 28, 2023
b91c987
updated test scripts
0xPilou Sep 28, 2023
4500246
cache
0xPilou Sep 28, 2023
ff13a4f
added implementation type constant state
0xPilou Sep 29, 2023
786d1b7
rename implementation type
0xPilou Sep 29, 2023
9321342
reviewed ERC721ABLE and ERC721AB (initDrop)
0xPilou Sep 29, 2023
0f01b31
cache
0xPilou Sep 29, 2023
6f5b955
added `contribute` section to readme
0xPilou Sep 29, 2023
fe91fa8
Merge pull request #15 from Anotherblock/ab558-standardNFT
0xPilou Sep 29, 2023
17b213b
Merge branch 'dev' into ab557-oe
0xPilou Sep 29, 2023
519f603
rework ERC721ABOE : inherit ERC721AB
0xPilou Oct 2, 2023
6f0d6c2
updated unit tests
0xPilou Oct 2, 2023
c942191
cache
0xPilou Oct 2, 2023
aa72be7
remove MAX_MINT checks in mint
0xPilou Oct 3, 2023
86f5dac
remove unit test for max mint check in ERC721ABOE
0xPilou Oct 3, 2023
e52758d
cache
0xPilou Oct 3, 2023
b57ee48
Merge pull request #14 from Anotherblock/ab557-oe
0xPilou Oct 9, 2023
3a93627
updated deployment addresses
0xPilou Oct 30, 2023
cec81dc
cache
0xPilou Oct 30, 2023
efa12ab
added deploy upgrade script
0xPilou Oct 30, 2023
26e9f7b
deployed upgrade on base goerli
0xPilou Oct 30, 2023
b6758af
added predict impl address
0xPilou Nov 2, 2023
35d790c
cache
0xPilou Nov 2, 2023
946c9c7
update config for fuzz.seed
0xPilou Nov 2, 2023
1c0c178
update foundry config : fuzz.seed
0xPilou Nov 2, 2023
ff51f59
fix foundry config
0xPilou Nov 2, 2023
3c1a04d
Merge pull request #16 from Anotherblock/ab677-predictImplAddress
0xPilou Nov 2, 2023
444c7ff
fix access control issue in CreatePublisherProfile function
0xPilou Nov 2, 2023
9073fca
cache
0xPilou Nov 2, 2023
3a8a171
Merge pull request #17 from Anotherblock/ab390-createPublisherRole
0xPilou Nov 2, 2023
80902b8
deploy new factory
0xPilou Nov 6, 2023
d224a76
added check on mint
0xPilou Nov 7, 2023
a681df0
cache
0xPilou Nov 7, 2023
4666a87
v1.1 deployment script
0xPilou Nov 7, 2023
ce08ede
cache
0xPilou Nov 7, 2023
5d12940
move constructor (disable initializer) to abstract contract
0xPilou Nov 7, 2023
c0299f2
updated deploy platform script (for base goerli)
0xPilou Nov 7, 2023
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
52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# <img src="ab-logo.png" alt="anotherblock" height="40px" align="left"> anotherblock platform contracts

## contribution workflow

### branches

this git repository is composed of two main branches and feature branches :

#### latest

`latest` branch is synchronized with the latest contracts deployed on _mainnet_.
_after every mainnet deployment and/or upgrade_, a pull request from `dev` to `latest` must be initiated and merged.
this branch is the reference for any integration with other sub-systems, i.e. frontend, subgraphs, and so on.

#### dev

`dev` branch is accumulating and consolidating all the new features, bug fixes and upgrades that are _not yet deployed on mainnet_.
_mainnet deployment must be initiated_ from `dev` branch only after the end-to-end tests have been successfully conducted on testnet.
_testnet deployment must be initiated_ from `dev` branch.

#### feature branches

feature branches are created every time a new feature, bug fix or upgrade must be developped.
feature branches are created from `dev` branch.
feature branches naming convention is `abXXX-featName` where XXX is the Linear Ticket ID and featName is a brief feature description.
a feature branch can be merge to `dev` _only if all required units tests have been conducted and passed_ and after approval from relevant stakeholders that the feature, bug fix or upgrade will be fit for deployement on mainnet.

### tags

_after every mainnet deployment and/or upgrade_, a tag must be created
tag naming convention is `vX.Y` where X & Y are digits.
we increment `X` for major update while we increment `Y` for small update or patches.

## install foundry

[foundry installation procedure](https://book.getfoundry.sh/getting-started/installation)
Expand Down Expand Up @@ -106,7 +137,6 @@ deploy standalone royalty contract for specific publisher

### base mainnet :


simulate platform deployment :

```sh
Expand All @@ -130,3 +160,23 @@ deploy standalone royalty contract for specific publisher
```sh
forge script script/base/deploy-royalty.s.sol:DeployRoyalty --rpc-url base --sig "run(address)" <publisherAddress> --broadcast --verify
```

## contribute

### creating new NFT minting mechanism

in order for anyone to create new minting mechanism NFT contract compatible with anotherblock self-service platform, the contract must comply with below requirements :

1. the new contract shall inherit the abstract contract [ERC721AB](src/token/ERC721/ERC721AB.sol)

2. the new contract state shall include two constants, `IMPLEMENTATION_VERSION` & `IMPLEMENTATION_TYPE`

3. the new contract shall include a function `initDrop` calling the internal function `_initDrop` and contain a minimum set of parameters :

- amount of share per token
- amount of genesis token to be minted
- recipient address of the genesis token(s)
- currency used to pay-out royalties
- base URI

4. the new contract shall include a custom mint function (see [ERC721ABLE](src/token//ERC721/ERC721ABLE.sol) for reference)
94 changes: 94 additions & 0 deletions broadcast/deploy-upgrade.s.sol/84531/run-1698658644.json

Large diffs are not rendered by default.

196 changes: 196 additions & 0 deletions broadcast/deploy-upgrade.s.sol/84531/run-1698658651.json

Large diffs are not rendered by default.

196 changes: 196 additions & 0 deletions broadcast/deploy-upgrade.s.sol/84531/run-1698658702.json

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions broadcast/deploy-upgrade.s.sol/84531/run-1698933961.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"transactions": [
{
"hash": "0xeabe34dcfea19a18b0dd7899af40f375eb75969788ca5ff94de8b1b3f7fd1756",
"transactionType": "CREATE",
"contractName": "AnotherCloneFactory",
"contractAddress": "0x2b0DDB1926B69337F83314537a24a2713da00fa5",
"function": null,
"arguments": null,
"transaction": {
"type": "0x02",
"from": "0xd71256ec24925873ce9e9f085f89864ca05970bd",
"gas": "0x1c9a2f",
"value": "0x0",
"data": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600054610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100dc576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6118a5806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80636b7e394911610104578063a217fddf116100a2578063d57f966b11610071578063d57f966b14610411578063d8f4b6fd1461041a578063e442ac181461042f578063fdbda0ec1461044257600080fd5b8063a217fddf146103ce578063bdd2fe78146103d6578063cfc5a0c0146103e9578063d547741f146103fe57600080fd5b8063832ca2f5116100de578063832ca2f5146103825780638d058ac81461039557806391d14854146103a85780639f1fb80d146103bb57600080fd5b80636b7e3949146103495780636cc82b841461035c5780637d2405bb1461036f57600080fd5b8063248a9ca31161017c57806347fcac3b1161014b57806347fcac3b146102fd5780634c7dfac314610310578063641254bd14610323578063678213491461033657600080fd5b8063248a9ca3146102935780632f2ff15d146102c457806336568abe146102d75780634128541c146102ea57600080fd5b80631c8518c2116101b85780631c8518c21461022f5780631ce6e4441461025a5780631e5b36841461026d578063229a8a821461028057600080fd5b806301ffc9a7146101df5780631459457a1461020757806318c25d8a1461021c575b600080fd5b6101f26101ed3660046113b7565b610475565b60405190151581526020015b60405180910390f35b61021a6102153660046113f8565b6104ac565b005b61021a61022a36600461145d565b61062d565b609b54610242906001600160a01b031681565b6040516001600160a01b0390911681526020016101fe565b609a54610242906001600160a01b031681565b61021a61027b366004611487565b61079c565b61024261028e366004611487565b61084e565b6102b66102a1366004611487565b60009081526065602052604090206001015490565b6040519081526020016101fe565b61021a6102d23660046114a0565b610868565b61021a6102e53660046114a0565b61088d565b609854610242906001600160a01b031681565b61024261030b36600461145d565b61090b565b6101f261031e3660046114cc565b61091f565b61021a6103313660046114cc565b610939565b61021a6103443660046114e7565b610967565b61021a6103573660046114cc565b610a4f565b609954610242906001600160a01b031681565b61021a61037d3660046114cc565b610a7f565b61021a6103903660046114cc565b610aad565b6102426103a3366004611487565b610adb565b6101f26103b63660046114a0565b610af5565b61021a6103c93660046115c6565b610b20565b6102b6600081565b609c54610242906001600160a01b031681565b6102b660008051602061183083398151915281565b61021a61040c3660046114a0565b610c4a565b6102b6609d5481565b6102b660008051602061185083398151915281565b61021a61043d36600461162c565b610c6f565b610455610450366004611487565b610d1b565b604080516001600160a01b039384168152929091166020830152016101fe565b60006001600160e01b03198216637965db0b60e01b14806104a657506301ffc9a760e01b6001600160e01b03198316145b92915050565b600054610100900460ff16158080156104cc5750600054600160ff909116105b806104e65750303b1580156104e6575060005460ff166001145b61054e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610571576000805461ff0019166101001790555b609880546001600160a01b03199081166001600160a01b0389811691909117909255609980548216888416179055609a80548216878416179055609b80548216868416179055609c80549091169184169190911790556000609d556105d4610d54565b6105df600033610dc1565b8015610625576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b60008051602061183083398151915261064581610dcb565b61271082111561066857604051632627b42d60e11b815260040160405180910390fd5b6001600160a01b03831661068f57604051632627b42d60e11b815260040160405180910390fd5b609c546000906106a7906001600160a01b0316610dd8565b60985460405163485cc95560e01b81526001600160a01b038781166004830152918216602482015291925082169063485cc95590604401600060405180830381600087803b1580156106f857600080fd5b505af115801561070c573d6000803e3d6000fd5b5050609854604051638353b91960e01b81526001600160a01b0388811660048301528581166024830152604482018890529091169250638353b9199150606401600060405180830381600087803b15801561076657600080fd5b505af115801561077a573d6000803e3d6000fd5b5050505061079660008051602061185083398151915285610e72565b50505050565b6000805160206118508339815191526107b481610dcb565b609b546000906107cd906001600160a01b031684610ef8565b60985460995460405163c0c53b8b60e01b81523360048201526001600160a01b039283166024820152908216604482015291925082169063c0c53b8b90606401600060405180830381600087803b15801561082757600080fd5b505af115801561083b573d6000803e3d6000fd5b505050506108498133610f95565b505050565b609a546000906104a6906001600160a01b031683306110ed565b60008281526065602052604090206001015461088381610dcb565b6108498383610e72565b6001600160a01b03811633146108fd5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610545565b6109078282611149565b5050565b60006109188383306110ed565b9392505050565b60006104a660008051602061185083398151915283610af5565b600061094481610dcb565b50609a80546001600160a01b0319166001600160a01b0392909216919091179055565b60008051602061183083398151915261097f81610dcb565b6127108211156109a257604051632627b42d60e11b815260040160405180910390fd5b6001600160a01b0384166109c957604051632627b42d60e11b815260040160405180910390fd5b609854604051638353b91960e01b81526001600160a01b03868116600483015285811660248301526044820185905290911690638353b91990606401600060405180830381600087803b158015610a1f57600080fd5b505af1158015610a33573d6000803e3d6000fd5b5050505061079660008051602061185083398151915285610868565b600080516020611830833981519152610a6781610dcb565b61090760008051602061185083398151915283610c4a565b6000610a8a81610dcb565b50609b80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610ab881610dcb565b50609c80546001600160a01b0319166001600160a01b0392909216919091179055565b609b546000906104a6906001600160a01b031683306110ed565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020611830833981519152610b3881610dcb565b609854604051630830b35960e31b81526001600160a01b038681166004830152909116906341859ac890602401602060405180830381865afa158015610b82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba69190611671565b610bc357604051634f3bd42760e01b815260040160405180910390fd5b6000610bcf8684610ef8565b60985460995460405163197a393d60e21b81529293506001600160a01b03808516936365e8e4f493610c0e938b93918216929116908a906004016116e3565b600060405180830381600087803b158015610c2857600080fd5b505af1158015610c3c573d6000803e3d6000fd5b505050506106258186610f95565b600082815260656020526040902060010154610c6581610dcb565b6108498383611149565b600080516020611850833981519152610c8781610dcb565b609a54600090610ca0906001600160a01b031684610ef8565b60985460995460405163197a393d60e21b81529293506001600160a01b03808516936365e8e4f493610cdf933393918216929116908a906004016116e3565b600060405180830381600087803b158015610cf957600080fd5b505af1158015610d0d573d6000803e3d6000fd5b505050506107968133610f95565b60978181548110610d2b57600080fd5b6000918252602090912060029091020180546001909101546001600160a01b0391821692501682565b600054610100900460ff16610dbf5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610545565b565b6109078282610e72565b610dd581336111b0565b50565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116610e6d5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610545565b919050565b610e7c8282610af5565b6109075760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610eb43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b0381166104a65760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401610545565b6040805180820182526001600160a01b0380851682528381166020830190815260978054600181018255600091909152925160029093027f354a83ed9988f79f6038d4c7a7dadbad8af32f4ad6df893e0e5807a1b1944ff9810180549484166001600160a01b031995861617905590517f354a83ed9988f79f6038d4c7a7dadbad8af32f4ad6df893e0e5807a1b1944ffa9091018054918316919093161790915560985491516331c3aba360e21b815291169063c70eae8c9061106b9085906004016001600160a01b0391909116815260200190565b600060405180830381600087803b15801561108557600080fd5b505af1158015611099573d6000803e3d6000fd5b50505050609d600081546110ac90611737565b909155506040516001600160a01b0380831691908416907f5d0de243db1669e3a7056744cd715c625f0c1c348736c2c2d53d0ddebff1a6c790600090a35050565b60405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b6111538282610af5565b156109075760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6111ba8282610af5565b610907576111c781611209565b6111d283602061121b565b6040516020016111e3929190611750565b60408051601f198184030181529082905262461bcd60e51b8252610545916004016117c5565b60606104a66001600160a01b03831660145b6060600061122a8360026117d8565b6112359060026117ef565b67ffffffffffffffff81111561124d5761124d611523565b6040519080825280601f01601f191660200182016040528015611277576020820181803683370190505b509050600360fc1b8160008151811061129257611292611802565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106112c1576112c1611802565b60200101906001600160f81b031916908160001a90535060006112e58460026117d8565b6112f09060016117ef565b90505b6001811115611368576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061132457611324611802565b1a60f81b82828151811061133a5761133a611802565b60200101906001600160f81b031916908160001a90535060049490941c9361136181611818565b90506112f3565b5083156109185760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610545565b6000602082840312156113c957600080fd5b81356001600160e01b03198116811461091857600080fd5b80356001600160a01b0381168114610e6d57600080fd5b600080600080600060a0868803121561141057600080fd5b611419866113e1565b9450611427602087016113e1565b9350611435604087016113e1565b9250611443606087016113e1565b9150611451608087016113e1565b90509295509295909350565b6000806040838503121561147057600080fd5b611479836113e1565b946020939093013593505050565b60006020828403121561149957600080fd5b5035919050565b600080604083850312156114b357600080fd5b823591506114c3602084016113e1565b90509250929050565b6000602082840312156114de57600080fd5b610918826113e1565b6000806000606084860312156114fc57600080fd5b611505846113e1565b9250611513602085016113e1565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261154a57600080fd5b813567ffffffffffffffff8082111561156557611565611523565b604051601f8301601f19908116603f0116810190828211818310171561158d5761158d611523565b816040528381528660208588010111156115a657600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080608085870312156115dc57600080fd5b6115e5856113e1565b93506115f3602086016113e1565b9250604085013567ffffffffffffffff81111561160f57600080fd5b61161b87828801611539565b949793965093946060013593505050565b6000806040838503121561163f57600080fd5b823567ffffffffffffffff81111561165657600080fd5b61166285828601611539565b95602094909401359450505050565b60006020828403121561168357600080fd5b8151801515811461091857600080fd5b60005b838110156116ae578181015183820152602001611696565b50506000910152565b600081518084526116cf816020860160208601611693565b601f01601f19169290920160200192915050565b6001600160a01b038581168252848116602083015283166040820152608060608201819052600090611717908301846116b7565b9695505050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161174957611749611721565b5060010190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611788816017850160208801611693565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516117b9816028840160208801611693565b01602801949350505050565b60208152600061091860208301846116b7565b80820281158282048414176104a6576104a6611721565b808201808211156104a6576104a6611721565b634e487b7160e01b600052603260045260246000fd5b60008161182757611827611721565b50600019019056fe2ceaf29507f118cd1f62635058556b732f02f44e3a3a133e73c60008a777fd3e0ac90c257048ef1c3e387c26d4a99bde06894efbcbff862dc1885c3a9319308aa264697066735822122048db67ee1ffecdefc42751a373454d0957c4a30cb81daab953553f592408248e64736f6c63430008130033",
"nonce": "0x496",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [
"0xeabe34dcfea19a18b0dd7899af40f375eb75969788ca5ff94de8b1b3f7fd1756"
],
"returns": {},
"timestamp": 1698933961,
"chain": 84531,
"multi": false,
"commit": "3a8a171"
}
Loading