wingsdao / wings-bridge Goto Github PK
View Code? Open in Web Editor NEWEasy integration with Wings
Home Page: https://wings.ai
License: GNU General Public License v3.0
Easy integration with Wings
Home Page: https://wings.ai
License: GNU General Public License v3.0
We should deploy our contracts right, before we start forecasting on Wings platform. So let's make a migration script...
What I did:
truffle init
node_modules
contracts
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()
};
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
}
}
};
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
added 296 packages in 40.064s
"dependencies": {
"chai": "^4.1.2",
"wings-integration": "^1.1.4",
"zeppelin-solidity": "^1.8.0"
}
chai to be dev
dependency
Now let's deploy bridge and direct crowdsale to bridge`
await deployer.deploy(Bridge, web3.toWei(10, 'ether'), web3.toWei(100, 'ether'), token.address, crowdsale.address)
const bridge = await Bridge.deployed()
Bridge itself is a BasicCrowdsale - contract Bridge is BasicCrowdsale
- and the naming conventions are not ideal here...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.