{"id":24857388,"url":"https://github.com/blend/zeppelinos-example","last_synced_at":"2025-10-15T03:30:21.983Z","repository":{"id":44099818,"uuid":"189241712","full_name":"blend/zeppelinos-example","owner":"blend","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-11T23:56:45.000Z","size":1495,"stargazers_count":5,"open_issues_count":19,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-07T18:44:55.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-29T14:27:58.000Z","updated_at":"2022-07-15T10:34:33.000Z","dependencies_parsed_at":"2025-01-31T17:53:26.804Z","dependency_job_id":"64a62450-8657-4bbb-a9ac-b4b197506973","html_url":"https://github.com/blend/zeppelinos-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blend/zeppelinos-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blend%2Fzeppelinos-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blend%2Fzeppelinos-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blend%2Fzeppelinos-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blend%2Fzeppelinos-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blend","download_url":"https://codeload.github.com/blend/zeppelinos-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blend%2Fzeppelinos-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279043014,"owners_count":26091362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-31T17:53:21.638Z","updated_at":"2025-10-15T03:30:21.640Z","avatar_url":"https://github.com/blend.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Making Ethereum Smart Contracts Upgradable\n\n*With ZeppelinOS 2.3 and Truffle 5*\n\nThis repo contains the example code for the tutorial on upgradable smart contracts in\n[Full Stack Finance: The Blend Engineering Blog](https://medium.com/blend-engineering).\nThis code aims to demonstrate, via a simple example, the steps that must be taken to deploy\nany Truffle project as an upgradable [ZeppelinOS](https://zeppelinos.org/) contract.\n\nThe main steps are as follows:\n1. Install and set up ZeppelinOS. [[3dc40f]](https://github.com/blend/zeppelinos-example/commit/3dc40f1d7fdd9b1689bda5a98c6a364aa871aa4f)\n2. Modify the contract and its base contracts to use initializer instead of constructors. [[eb84c5]](https://github.com/blend/zeppelinos-example/commit/eb84c59506ea38d5e0c0f91a3485917340beea3b)\n3. Update the migrations. [[8d4a32]](https://github.com/blend/zeppelinos-example/commit/8d4a32d326a337666e73c90d99f2e62cf3297020)\n4. Add a warning comment about the storage layout [[334f42]](https://github.com/blend/zeppelinos-example/commit/334f42eada758cd49af57f6b62321949bbbd535e)\n5. Deploy the upgradable contract. (see steps below)\n\nThe commits in this repository are designed to mirror the steps taken in the tutorial.\n\nThis code is based on the [MetaCoin Truffle Box](https://github.com/truffle-box/metacoin-box)\nexample project by the Truffle team.\n\n## Getting started\n\nInstall dependencies:\n\n```bash\nnpm install\n```\n\nRun the tests—they should pass:\n\n```\nnpx truffle test\n```\n\n## Deployment\n\nThe config file `truffle-config.json` can be used to deploy to the Kovan test network\nor the Ethereum main network.\n\nThe config depends on the following environment variables:\n- `MNEMONIC`: Twelve-word secret phrase, which you can get from a wallet provider like MetaMask.\n- `INFURA_KEY`: Infura API key, which you can get from https://infura.io/register.\n\nThe account unlocked by the wallet must have some Ether to fund the deployment gas costs.\nBy default, the first account in the wallet is used. See\n[`truffle-hdwallet-provider`](https://github.com/trufflesuite/truffle/tree/develop/packages/truffle-hdwallet-provider)\nfor additional configuration options.\n\nFor convenience, we also define the following environment variables:\n- `NETWORK`: One of the network names from your Truffle config, e.g. `main`.\n- `UPGRADABILITY_OWNER`: An Ethereum address which will have the ability to\n  push upgrades to the upgradable contract. Must be unlocked by the Truffle config.\n\nInformation about previously deployed contracts is stored in `zos.kovan.json` and\n`zos.mainnet.json`. If you want to deploy from scratch, you can delete these files.\n\n### Deploy the logic contract\n\nStart a ZeppelinOS session and verify that we're able to talk to the network:\n\n```bash\nnpx zos session --network $NETWORK --from $UPGRADABILITY_OWNER --expires 3600\nnpx zos status\n```\n\nIf there are no errors, then we can deploy the logic contract:\n\n```bash\nnpx zos push\n```\n\nWhen finished, information about the deployed contract will be saved to\n`zos.$NETWORK.json`. It is **very important** to check this file into version control.\n\n### Deploy the proxy contract\n\nStart a ZeppelinOS session if needed, then run the following:\n\n```bash\nnpx zos create MetaCoin --init initialize --args $UPGRADABILITY_OWNER\n```\n\nThe initialzer `args` option will depend on your smart contract. In this case, we're\nreusing the `UPGRADABILITY_OWNER` as the contract owner address to be passed into\nthe `Ownable.sol` initializer. If your initializer takes multiple arguments, they can\nbe passed in as a comma-separated list, with no spaces in between.\n\nThe proxy address will be written to the console output. This is the address that you\nshould direct your users to.\n\n### Deploy an upgrade\n\nStart a ZeppelinOS session if needed, then deploy a new logic contract:\n\n```bash\nnpx zos push\n```\n\nUpdate the previously created proxy contract to point to the new logic contract:\n\n```bash\nnpx zos update MetaCoin\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblend%2Fzeppelinos-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblend%2Fzeppelinos-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblend%2Fzeppelinos-example/lists"}