See Alpha agreement if you are going to use these contracts
Story Protocol is a decentralized IP protocol for powering the next wave of creative innovation on the Internet. By providing a decentralized IP registry and a set of powerful modules centered around IP licensing, Story Protocol enables creators to build new forms of IP without the friction imposed by traditional processes.
See our contribution guidelines
Please install the following:
And you probably already have make
installed... but if not try looking here. and here for MacOS
make # This installs the project's dependencies.
make test
make test
or
forge test
make coverage
Open index.html
in coverage/
folder.
Copy .env.example into .env, and set the required variables.
Deploy local
anvil
(open other tab)
forge script script/foundry/deployment/Main.s.sol:Main --fork-url=http://127.0.0.1:8545
Deploy to network dry run
forge script script/foundry/deployment/Main.s.sol:Main --fork-url=<network rpc url url> -vvvv
Deploy to network
forge script script/foundry/deployment/Main.s.sol:Main --fork-url=<network rpc url url> -vvvv --broadcast --verify
Before using any task, make sure you have run
npx hardhat compile
NOTE: All task that generate transactions can be called with additional param --events true
so they print the tx receipt's events
Create a Franchise
npx hardhat --network <networ name> sp:create-franchise -name="Test" -description="Short description" -symbol="TT"
Get Franchise Address for ID
npx hardhat sp:get-ip-asset-registry-address --network <network> <franchiseId>
Create Story Block
npx hardhat sp:create-ip-asset --network <network> <franchiseId> <IPAssetType name, like "ART", "STORY"...> <name> <description> "https://www.youtube.com/watch\?v\=dQw4w9WgXcQ"
Read Story Block
npx hardhat sp:read-ip-asset--network <network> <franchiseId> <IPAssetId>
Foundry comes with local network anvil baked in, and allows us to deploy to our local network for quick testing locally.
To start a local network run:
make anvil
This will spin up a local blockchain with a determined private key, so you can use the same private key each time.
Defined in our Guidelines
To check code style with solhint run:
make lint
To re-format code with prettier run:
make format
We use slither, a popular security framework from Trail of Bits. To use slither, you'll first need to install python and install slither.
Then, you can run:
make slither
And get your slither output.
We use solidity-docgen to generate the documents for smart contracts. Documents can be generated with the following command:
npx hardhat docgen
By default, the documents are generated in Markdown format in the doc
folder of the project. Each Solidity file (*.sol
) has its own Markdown (*.md
) file. To update the configuration for document generation, you can update the following section in harhat.config.js
:
docgen: {
outputDir: "./docs",
pages: "files"
}
You can refer to the config.ts of solidity-docgen for the full list of configurable parameters.
The primary license for StoryProtocol is the Alpha Testing Agreement, seeΒ LICENSE. Minus the following exceptions: