WingsDao / wings-bridge

Easy integration with Wings
https://wings.ai
GNU General Public License v3.0
1 stars 0 forks source link

Migration script... Assuming truffle. When to introduce truffle to a reader? #3

Open stefek99 opened 6 years ago

stefek99 commented 6 years ago

We should deploy our contracts right, before we start forecasting on Wings platform. So let's make a migration script...

What I did:

const Crowdsale = artifacts.require('Crowdsale');
const Token = artifacts.require('Token');
const Bridge = artifacts.require('Bridge');

module.exports = async function(deployer, network, accounts) {
    // Deploying token
    await deployer.deploy(Token)
    const token = await Token.deployed()

    // Deploying Crowdsale
    await deployer.deploy(Crowdsale, token.address)
    const crowdsale = await Crowdsale.deployed()

    // Move token owner to crowdsale
    await token.transferOwnership(crowdsale.address)

    await deployer.deploy(Bridge, web3.toWei(10, 'ether'), web3.toWei(100, 'ether'), token.address, crowdsale.address)
    const bridge = await Bridge.deployed()
};

Looks like success

Which deployer do you use? Is it Truffle? If yes, I'll edit the readme.md and start with Truffle...

MacBook-Pro-10:wings-integration-gnosis-truffle zen$ truffle migrate
Using network 'development'.

Running migration: 2_deploy.js
  Deploying Token...
  ... 0x7ded637d4be22963077f41f3169bd4626993b6aacdd6cdc1f65307f7021d6cc0
  Token: 0xee9d968659fdc041ba5c3f2ac06a5b6e89197227
Saving successful migration to network...
  Deploying Crowdsale...
  ... 0x8e0ab5bc162dceecce3b803f125d058426195749817f4789e0aedfcdf962bb2b
Saving artifacts...
  ... 0xb54188eff79fcb8fde416ec29b21091e609a727b49932eedc0ce27dd28fee3c3
  Crowdsale: 0xb27ac59f336f4e5b7ff82f09f21fa6c74ae7ace8
  ... 0xb269c217a3194182dc3c1f58416752be5b5b4156601e61e09655038dc76290b9
  Deploying Bridge...
  ... 0x6c9be40dc06c576e0a18c4921654d463488d0d87e86c247e0febc8a040a00b8c
  Bridge: 0x066855b6287c2ce96f9ad6af6a3650ac443fec2d
borispovod2 commented 6 years ago

Yes, it's truffle. Truffle introduced as standard framework for smart contracts developing/testing, but if it's not obvious, we should add some notes.

stefek99 commented 6 years ago

I think we are both right.

Truffle is a standard.

For those who don't know - make it more obvious.

The readme.md has great quality, well done!

borispovod2 commented 6 years ago

@stefek99 so do PR to repo and update README.md to provide more info about truffle or just close issue :)