Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.openzeppelin Rename Project, Network, Sesion and Lock files (#1040) Jun 27, 2019
contracts Rename ZeppelinOS/zos references, ZosConfig object and cli/lib packag… Jul 12, 2019
test New example: 'dynamic-instance` (#724) Feb 25, 2019
.gitignore Rename examples (#1096) Jul 16, 2019 Rename examples (#1096) Jul 16, 2019
index.js Fixed link to fixed subheading anchor (#1173) Aug 14, 2019
package-lock.json v2.5.0 Jul 19, 2019
package.json v2.5.3 Aug 18, 2019
truffle-config.js New create2 command (#757) Mar 8, 2019

OpenZeppelin SDK example: creating upgradeable contracts from Solidity

This project demonstrates how to create instances of upgradeable contracts using contract factory. It consists of two smart contracts: Instance (a simple contract that stores a value) and Factory which is a contract factory to create Instance contracts. In this example, we use the script executed with Truffle, but the entire process can be also done from the openzeppelin CLI.

Running the project

To run this project locally first, install all dependencies with:

$ npm install

Then start a ganache instance by running:

$ npx ganache-cli --port 9545

Next run index.js script using the command:

$ npm run start

The code

index.js script executes the whole process of the creation of upgradeable contracts from another contract including contracts compilation, openzeppelin project initiation, registering contracts in the openzeppelin project, pushing them to the network, creating Factory contract and then using it to create upgradeable Instance contract.

You can’t perform that action at this time.