Welcome to the Story PoC Periphery repository. This repository contains the peripheral smart contracts for the Story Proof-of-Creativity (PoC) Protocol. These contracts simplify developers’ work by allowing them to bundle multiple interactions with the PoC protocol - like registering an IP Asset and attaching License Terms to that IP Asset - into a single transaction.
For access to the core PoC contracts, please visit the protocol-core-v1 repository.
🚧 WARNING, Beta version: This code is in active development and unaudited. Do not use in production.
Story PoC Periphery combines multiple common independent interactions with the Story PoC Protocol into a single transaction.
For example, this mintAndRegisterIpAndAttachPILTerms
is one of the functions that allows you to mint an NFT, register it as an IP Asset, and attach License Terms to it all in one call.
function mintAndRegisterIpAndAttachPILTerms(
address nftContract,
address recipient,
IPMetadata calldata ipMetadata,
PILTerms calldata terms
) external onlyCallerWithMinterRole(nftContract) returns (address ipId, uint256 tokenId, uint256 licenseTermsId)
For a list of currently supported workflows, check out the Workflows documentation.
Batch calling functions is supported both natively and through the Multicall3
contract. For more information, check out the Multicall documentation.
contracts are deployed on Story Testnet at the following addresses:
{
"DerivativeWorkflows": "0xE0e1d222E024bF14B1e0A4b48fC6e6B6F8ebaEB3",
"GroupingWorkflows": "0xfAa9CCd49DCDfB9a950CBF036cD6082e623a6bcC",
"LicenseAttachmentWorkflows": "0xC7A40c41Cbe44C6B326447081877d69F98127C59",
"RegistrationWorkflows": "0x8D8E0d24E7B6420d3209EfA185Fa451c95D8316A",
"RoyaltyWorkflows": "0x19E435b1C0857375F9423C8ba508203054CE1d9F",
"SPGNFTBeacon": "0xD753c698aE69194C851d60BF759d537DE7477696",
"SPGNFTImpl": "0xA12e66a4429c9B7f38893c9b00E80646e0e76446"
}
Please install Foundry / Foundryup
yarn # this installs packages
forge build # this builds
forge clean
forge compile --build-info
- Edit
script/foundry/utils/upgrades/ERC7201Helper.s.sol
- Change
string constant CONTRACT_NAME = "<the contract name>";
- Run the script to generate boilerplate code for storage handling and the namespace hash:
forge script script/utils/upgrades/ERC7201Helper.s.sol
- The log output is the boilerplate code, copy and paste in your contract
forge test -vvvv
forge coverage
See Deploy & Upgrade documentation for more information.
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.
We employed solhint to check code style. 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.
Please see our contribution guidelines.
MIT License, details see: LICENSE.