Skip to content

anotherblock self-serving platform smart contracts repository

Notifications You must be signed in to change notification settings

Anotherblock/contracts-v2

Repository files navigation

anotherblock 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

setup environment

create .env file in the root directory as per .env.example

cp .env.example .env

source the .env file (from the root directory):

source .env

compile contracts

forge build

test contracts

execute full test campaign :

forge test -vvv

analyze test coverage :

forge coverage

deploy contracts

optimism goerli :

deploy and verify ABSuperToken (superfluid mock token) :

forge script script/op/deploy-ABSuperToken.s.sol:DeployMockSuperToken --rpc-url optimism-goerli --broadcast --verify --etherscan-api-key ${OPTIMISM_ETHERSCAN_API_KEY}

simulate platform deployment :

    forge script script/op/deploy-platform.s.sol:DeployPlatform --rpc-url optimism-goerli --sig "run(bool)" true

deploy and verify anotherblock platform contracts :

    forge script script/op/deploy-platform.s.sol:DeployPlatform --rpc-url optimism-goerli --broadcast --verify --etherscan-api-key ${OPTIMISM_ETHERSCAN_API_KEY} --sig "run(bool)" false

simulate ABRoyalty deployment

    forge script script/op/deploy-royalty.s.sol:DeployRoyalty --rpc-url base-goerli --sig "run(address)" <publisherAddress>

deploy standalone royalty contract for specific publisher

    forge script script/op/deploy-royalty.s.sol:DeployRoyalty --rpc-url base-goerli --sig "run(address)" <publisherAddress> --broadcast --verify

base goerli :

deploy and verify ABSuperToken (superfluid mock token) :

forge script script/base-goerli/deploy-ABSuperToken.s.sol:DeployMockSuperToken --rpc-url base-goerli --broadcast --verify

simulate platform deployment :

    forge script script/base-goerli/deploy-platform.s.sol:DeployPlatform --rpc-url base-goerli --sig "run(bool)" true

deploy and verify anotherblock platform contracts :

    forge script script/base-goerli/deploy-platform.s.sol:DeployPlatform --rpc-url base-goerli --broadcast --verify --sig "run(bool)" false

simulate ABRoyalty deployment

    forge script script/base-goerli/deploy-royalty.s.sol:DeployRoyalty --rpc-url base-goerli --sig "run(address)" <publisherAddress>

deploy standalone royalty contract for specific publisher

    forge script script/base-goerli/deploy-royalty.s.sol:DeployRoyalty --rpc-url base-goerli --sig "run(address)" <publisherAddress> --broadcast --verify

base mainnet :

simulate platform deployment :

    forge script script/base/deploy-platform.s.sol:DeployPlatform --rpc-url base --sig "run(bool)" true

deploy and verify anotherblock platform contracts :

    forge script script/base/deploy-platform.s.sol:DeployPlatform --rpc-url base --broadcast --verify --sig "run(bool)" false

simulate ABRoyalty deployment

    forge script script/base/deploy-royalty.s.sol:DeployRoyalty --rpc-url base --sig "run(address)" <publisherAddress>

deploy standalone royalty contract for specific publisher

    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

  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 for reference)

About

anotherblock self-serving platform smart contracts repository

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •