Last active
May 23, 2018 19:34
-
-
Save mseijas/7be8e01792c3b4ad73b37c1aa35f1bcb to your computer and use it in GitHub Desktop.
This file contains 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 ImageURL via Proxy | |
const proxySocialNetwork = SocialNetworkV1.at(proxy.address) | |
await proxySocialNetwork.setImageUrl('http://tanookilabs.com/images/tanooki-small@2x-0500fc1e.png') | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment