Skip to content

Instantly share code, notes, and snippets.

@mseijas
Last active May 23, 2018 19:34
Show Gist options
  • Save mseijas/7be8e01792c3b4ad73b37c1aa35f1bcb to your computer and use it in GitHub Desktop.
Save mseijas/7be8e01792c3b4ad73b37c1aa35f1bcb to your computer and use it in GitHub Desktop.
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