Meme Factory EVM Package
This repository contains MemeFactory smart contracts packaged as a reusable EVM Package. You can deploy them as-is, or extend to suit your needs to build custom contracts and more complex decentralized systems.
Install
npm install memefactory-contracts
Packaged contracts
- DSAuth
- DSGuard
- EternalDb
- Registry
- MiniMeTokenFactory
- DankToken
- MemeToken
- MemeFactory
Development
prerequisites
You need ZeppelinOS comand-line interface installed:
npm install --global zos
Using this package
Create a new ZeppelinOS project, and add the memefactory-contracts
EVM package:
zos init MyProjectzos link memefactory-contracts
Start session with a network called local
(defined in truffle-config), using an address different from the default:
zos session --network local --from <address> --expires 3600
Deploy all the added logic contracts to the network (note that this step is only needed on local networks, when working on public networks ZeppelinOS will automatically used the pre-deployed implementation contracts):
zos push --deploy-dependencies
Developing and contributing to this package
Initialize project:
zos init memefactory-contracts
Add contracts:
zos add DSAuth:ds-authzos add DSGuard:ds-guardzos add EternalDb:meme-registry-dbzos add Registry:meme-registryzos add App:token-factoryzos add DankToken:DANKzos add MemeToken:meme-tokenzos add MemeFactory:meme-factory
Start session with a testrpc network called ganache
(defined in truffle-config):
zos session --network ganache --from <address> --expires 3600
Deploy all the added logic contracts to the network:
zos push --force
Publish the contracts:
zos publish --network ganache --from <address>
Updating packaged contracts
Update to a new version of the package and deploy changes to the logic contracts:
zos link memefactory-contracts@new-versionzos push --deploy-dependencies
Deploy updated instances of the contracts to interact with:
zos update meme-factory
Deploy upgradeable instances of the contracts:
OWNER=<address>DB=$(zos create meme-registry-db --init initialize)REGISTRY=$(zos create meme-registry --init --args $DB,$OWNER)TOKEN_FACTORY=$(zos create token-factory)DANK_TOKEN=$(zos create DANK --init --args $TOKEN_FACTORY,1000000000000000000000000000,$OWNER)MEME_TOKEN=$(zos create meme-token --init --args $REGISTRY)MEME_FACTORY=$(zos create meme-factory --init --args $REGISTRY,$DANK_TOKEN,$MEME_TOKEN,1)
Interact with the contracts
NOTE
When interacting with deployed contracts use a different address than that of the owner (admin) addressed used when creating it. The transparent proxy pattern posits that the calls from the admin address will not be delegated to the proxy contract holding the logic.
npx truffle console --network ganache
var address='contract-instance-address';memeFactory=MemeFactory.atvar opts = {from: 'address'};memeFactory.version
License
Released under the Eclipse Public License