Created
May 23, 2018 19:35
-
-
Save mseijas/90c26b96b2c2f1cdac75195cd55f221b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SocialNetworkProxy = artifacts.require('SocialNetworkProxy') | |
const SocialNetworkV1 = artifacts.require('SocialNetworkV1') | |
module.exports = deployer => { | |
deployer.then(async () => { | |
let proxy, socialNetworkV1 | |
// 1. Deploy SocialNetworkProxy | |
proxy = await deployer.deploy(SocialNetworkProxy) | |
// 2. Deploy SocialNetworkV1 contract | |
socialNetworkV1 = await deployer.deploy(SocialNetworkV1) | |
// 3. Link SocialNetworkProxy with SocialNetworkV1 contract | |
await proxy.upgradeTo(socialNetworkV1.address) | |
// 4. Update Name + ImageURL via Proxy | |
const proxySocialNetwork = SocialNetworkV1.at(proxy.address) | |
await proxySocialNetwork.setName('TanookiChats') | |
await proxySocialNetwork.setImageUrl('http://tanookilabs.com/images/[email protected]') | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment