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.
npm install memefactory-contracts
- DSAuth
- DSGuard
- EternalDb
- Registry
- MiniMeTokenFactory
- DankToken
- MemeToken
- MemeFactory
You need ZeppelinOS comand-line interface installed:
npm install --global zos
Create a new ZeppelinOS project, and add the memefactory-contracts
EVM package:
zos init MyProject
zos 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
Initialize project:
zos init memefactory-contracts
Add contracts:
zos add DSAuth:ds-auth
zos add DSGuard:ds-guard
zos add EternalDb:meme-registry-db
zos add Registry:meme-registry
zos add App:token-factory
zos add DankToken:DANK
zos add MemeToken:meme-token
zos 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>
Update to a new version of the package and deploy changes to the logic contracts:
zos link memefactory-contracts@new-version
zos push --deploy-dependencies
Deploy updated instances of the contracts to interact with:
zos update meme-factory
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)
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.at(address)
var opts = {from: 'address'};
memeFactory.version(opts)
Released under the Eclipse Public License