Deployment
Deployment of the Demo
A demo script is provided that sets up the protocol, several protocol supported assets, rules, and admins. This demo can be deployed to a local anvil or any EVM compatible chain including testnets and mainnet.
Included In The Demo
- Full Protocol Deployment
- RulesProcessor and all facets
- Dr. Frankenstein’s Lab Application Deployment including:
- AppManager
- ApplicationHandler
- Frankenstein Coin (ApplicationERC20)
- Connected Token Handler (HandlerDiamond)
- Dracula Coin (ApplicationERC20)
- Connected Token Handler (HandlerDiamond)
- Wolfman NFT (ApplicationERC721AdminOrOwnerMint)
- Connected Token Handler (HandlerDiamond)
- NFT Pricing Contract (ApplicationERC721Pricing)
- ERC20 Pricing Contract (ApplicationERC20Pricing)
- Approve List Oracle (OracleApproved)
- Deny List Oracle (OracleDenied)
- AppManager
- Mint 1 billion Frankenstein coins
- Set the price of Wolfman NFT’s to $1 USD
- Add Application Administrator role to the provided address
- Add Rule Administrator role to the provided address
- Add provided address to the oracle approve list
- Use provided address to create an
Account Min/Max Token Balance Rule
- Apply the ‘Account Min/Max Token Balance Rule’ to Frankenstein Coin P2P_TRANSFER actions
- Generate terminal export commands for ease of use
Prerequisites
foundry, pull the code, and then run in the root of the project’s directory:
Note: awk
in the above command is used to ignore comments in foundry.lock
Local Demo Requirements
- Address and private key from the Anvil addresses
Testnet Demo Requirements
- Application Administrator Address and private key(This should be controlled by the deployer and funded)
- Rule Administrator Address and private key(This should be controlled by the deployer and funded)
- RPC url for the target testnet
- Chain ID for the target testnet
- Gas Price Setting for the target testnet(This is to aid successful deployment and prevent timeouts)
- User1 Address(This should be controlled by the deployer and funded)
- User2 Address(This should be controlled by the deployer and funded)
- Protocol Deployment Owner Address and private key(This should be controlled by the deployer and funded)
Optional
Rule Processor Address(only required ifProtocal Already Deployed
is set toy
)
Running DemoSetup.sh
- Open a terminal in the project root directory
- Run the following command in the terminal
- Enter the data prompted by the script
Testing
- Copy the generated export statements to your terminal and run them. NOTE: They can be copy/pasted and run in one large chunk. Example:
- Transfer 100 Frankenstein coins to User 1
- Check User 1 Frankenstein coin Balance
- Attempt to Transfer Over Max Balance - THIS WILL VIOLATE THE RULE AND FAIL