Skip to content
Permalink
Browse files

Merge pull request #407 from airswap/update-deployer

publishing updates to deployer including transfers
  • Loading branch information
poiresel committed Jan 31, 2020
2 parents 4ceddfd + ed37bdf commit 953956f308c65ec53d1f1b20d35f47fe04b936af
@@ -1,4 +1,4 @@
{
"1": "0xCA109988465266970bE8fd0048A7e235b9e62Bc3",
"4": "0xd393FB3f3062e208049FC75B26BFa5aB0890CBB3"
"1": "0x072073f78a2d58610Ee3d5e170CA7AC9CB58a345",
"4": "0xe01cE51C3CB0B68b5Fa07CCBD9544AeEcd006e6E"
}
@@ -1,12 +1,16 @@
const DelegateFactory = artifacts.require('DelegateFactory')
const Delegate = artifacts.require('Delegate')

module.exports = (deployer, network) => {
if (network == 'rinkeby' || network == 'mainnet') {
module.exports = async(deployer, network) => {
// fill in the addresses below
const SWAP_ADDRESS = ''
const INDEXER_ADDRESS = ''
const OWNER_ADDRESS = ''
const TRADE_WALLET_ADDRESS = ''
deployer.deploy(Delegate, SWAP_ADDRESS, INDEXER_ADDRESS, OWNER_ADDRESS, TRADE_WALLET_ADDRESS)
const FACTORY_PROTOCOL = '0x0001'

if (network == 'mainnet' || network == 'rinkeby') {
await deployer.deploy(DelegateFactory, SWAP_ADDRESS, INDEXER_ADDRESS, FACTORY_PROTOCOL)
await deployer.deploy(Delegate, SWAP_ADDRESS, INDEXER_ADDRESS, OWNER_ADDRESS, TRADE_WALLET_ADDRESS, FACTORY_PROTOCOL)
}
};
@@ -1,6 +1,6 @@
{
"name": "@airswap/delegate",
"version": "1.5.8",
"version": "2.6.8-beta.0",
"description": "Deployable Trading Rules for the AirSwap Network",
"contributors": [
"Don Mosites <don.mosites@fluidity.io>",
@@ -27,14 +27,14 @@
"verify": "truffle run verify"
},
"devDependencies": {
"@airswap/order-utils": "0.3.19",
"@airswap/order-utils": "0.3.20-beta.0",
"@airswap/test-utils": "0.1.4",
"@airswap/transfers": "0.0.2",
"@airswap/transfers": "1.1.2-beta.0",
"solidity-coverage": "^0.6.3"
},
"dependencies": {
"@airswap/indexer": "3.6.8",
"@airswap/swap": "4.3.7",
"@airswap/swap": "5.4.7-beta.0",
"openzeppelin-solidity": "2.4"
}
}
@@ -23,7 +23,7 @@ module.exports = {
provider: () =>
new HDWalletProviderPriv(
[process.env.PRIVATE_KEY],
'https://mainnet.infura.io/v3/' + process.env.INFURA_API_KEY
process.env.MAINNET_NODE
),
gas: 5898551,
gasPrice: 15900000000, // CHECK THE CURRENT GASPRICE
@@ -27,10 +27,10 @@
"verify": "truffle run verify"
},
"devDependencies": {
"@airswap/order-utils": "0.3.19",
"@airswap/order-utils": "0.3.20-beta.0",
"@airswap/test-utils": "0.1.4",
"@airswap/transfers": "0.0.2",
"@airswap/types": "2.4.5",
"@airswap/transfers": "1.1.2-beta.0",
"@airswap/types": "3.5.5-beta.0",
"bignumber.js": "^9.0.0",
"solidity-coverage": "^0.6.3"
},
@@ -1,4 +1,4 @@
{
"1": "0x3E0c31C3D4067Ed5d7d294F08B79B6003B7bf9c8",
"4": "0xa03855b0695013cF331FbD91dd7cBc4C2211793f"
"1": "0x4572f2554421Bd64Bef1c22c8a81840E8D496BeA",
"4": "0x2e7373D70732E0F37F4166D8FD9dBC89DD5BC476"
}
@@ -1,6 +1,6 @@
{
"name": "@airswap/swap",
"version": "4.3.7",
"version": "5.4.7-beta.0",
"description": "Trustlessly swap tokens on the AirSwap Network",
"contributors": [
"Don Mosites <don.mosites@fluidity.io>",
@@ -27,15 +27,15 @@
"verify": "truffle run verify"
},
"devDependencies": {
"@airswap/order-utils": "0.3.19",
"@airswap/order-utils": "0.3.20-beta.0",
"@airswap/test-utils": "0.1.4",
"@airswap/tokens": "0.1.4",
"solidity-coverage": "^0.6.3",
"solidity-docgen": "0.3.0-beta.3"
},
"dependencies": {
"@airswap/transfers": "0.0.2",
"@airswap/types": "2.4.5",
"@airswap/transfers": "1.1.2-beta.0",
"@airswap/types": "3.5.5-beta.0",
"openzeppelin-solidity": "2.4"
}
}
@@ -0,0 +1,4 @@
{
"1": "0xB8bCcF216f2788Bb6df9fA15666a0a785730dcC0",
"4": "0xb6B275F519AFfF2E13cfD7e073A109eb8a1B03ad"
}
@@ -1,6 +1,6 @@
{
"name": "@airswap/transfers",
"version": "0.0.2",
"version": "1.1.2-beta.0",
"description": "A registry to manage token transfers on the AirSwap Network",
"license": "Apache-2.0",
"repository": {
@@ -17,7 +17,7 @@
"test": "truffle test"
},
"devDependencies": {
"@airswap/order-utils": "0.3.19",
"@airswap/order-utils": "0.3.20-beta.0",
"@airswap/test-utils": "0.1.4",
"@airswap/tokens": "0.1.4",
"solidity-coverage": "^0.6.3"
@@ -13,13 +13,13 @@ const {
ERC20_INTERFACE_ID,
ERC721_INTERFACE_ID,
ERC1155_INTERFACE_ID,
CK_INTERFACE_ID,
} = require('@airswap/order-utils').constants

contract('TransferHandlerRegistry', async accounts => {
const aliceAddress = accounts[0]
const bobAddress = accounts[1]
const carolAddress = accounts[2]
const CKITTY_KIND = '0x9a20483d'
let tokenAST
let tokenTicket
let tokenKitty
@@ -55,7 +55,7 @@ contract('TransferHandlerRegistry', async accounts => {
// failed to add kittyCore by bob since non-owner
reverted(
transferHandlerRegistry.addTransferHandler(
CKITTY_KIND,
CK_INTERFACE_ID,
kittyCoreHandler.address,
{ from: bobAddress }
),
@@ -75,7 +75,7 @@ contract('TransferHandlerRegistry', async accounts => {

// add all 4 of these contracts into the TokenRegistry
await transferHandlerRegistry.addTransferHandler(
CKITTY_KIND,
CK_INTERFACE_ID,
kittyCoreHandler.address
)
await transferHandlerRegistry.addTransferHandler(
@@ -304,12 +304,12 @@ contract('TransferHandlerRegistry', async accounts => {

it('Carol fails to perform transfer of CKITTY collectable #54321 from Bob to Alice when an amount is set', async () => {
const handlerAddress = await transferHandlerRegistry.transferHandlers.call(
CKITTY_KIND
CK_INTERFACE_ID
)
equal(
handlerAddress,
kittyCoreHandlerAddress,
'Kind does not match CKITTY interface id'
'Kind does not match CK_INTERFACE_ID'
)

await reverted(
@@ -1,4 +1,4 @@
{
"1": "0xef5ED6D6f1600C56c54c51841bCF97421CDdb52d",
"4": "0xe25b7504856bfb230b7c32BC87047479815cbc70"
"1": "0xa42d613D8B8B6cB9507F46A5dd3FD98276570FD7",
"4": "0x42d0f5fE517A0e4aB8be2F3FA7799fB96E30E777"
}
@@ -1,6 +1,6 @@
{
"name": "@airswap/types",
"version": "2.4.5",
"version": "3.5.5-beta.0",
"description": "Solidity structs and hashing used on the AirSwap Network",
"contributors": [
"Don Mosites <don.mosites@fluidity.io>",
@@ -28,7 +28,7 @@
},
"devDependencies": {
"@airswap/tokens": "0.1.4",
"@airswap/order-utils": "0.3.19",
"@airswap/order-utils": "0.3.20-beta.0",
"solidity-coverage": "^0.6.3"
},
"dependencies": {
@@ -1,4 +1,4 @@
{
"1": "0xC4c01Afb1211E007CFA48f56552FB8a8B0Bdc51c",
"4": "0x33356FcCF3bdeb37f3CD3Dc5382Ae5BF4AAda26c"
"1": "0x28de5C5f56B6216441eE114e832808D5B9d4A775",
"4": "0x8C80e2c9C5244C2283Da85396dde6b7af4ebaA31"
}
@@ -1,6 +1,6 @@
{
"name": "@airswap/wrapper",
"version": "2.5.8",
"version": "3.6.8-beta.0",
"description": "Wraps and unwraps ether for WETH trades on the AirSwap Network",
"contributors": [
"Don Mosites <don.mosites@fluidity.io>",
@@ -28,14 +28,14 @@
"verify": "truffle run verify"
},
"devDependencies": {
"@airswap/order-utils": "0.3.19",
"@airswap/order-utils": "0.3.20-beta.0",
"@airswap/test-utils": "0.1.4",
"@airswap/indexer": "3.6.8",
"solidity-coverage": "^0.6.3"
},
"dependencies": {
"@airswap/delegate": "1.5.8",
"@airswap/swap": "4.3.7",
"@airswap/delegate": "2.6.8-beta.0",
"@airswap/swap": "5.4.7-beta.0",
"@airswap/tokens": "0.1.4"
}
}
@@ -21,8 +21,8 @@
"mocha": "^6.2.0"
},
"dependencies": {
"@airswap/order-utils": "0.3.19",
"@airswap/swap": "4.3.7",
"@airswap/order-utils": "0.3.20-beta.0",
"@airswap/swap": "5.4.7-beta.0",
"@airswap/tokens": "0.1.4",
"ethers": "^5.0.0-beta.159"
}
@@ -39,5 +39,5 @@ MAINNET_STAKE="0x27054b13b1b798b345b591a4d22e6562d47ea75a"
If looking to verify on a network besides `development`, one can append the verification commands for the contracts that wish to be verified
```
yarn migrate --network rinkeby && sleep 40 && yarn verify Types Wrapper DelegateFactory Indexer Swap flatten/Flattened.sol --network rinkeby
yarn migrate --network mainnet && sleep 40 && yarn verify Types Wrapper DelegateFactory Indexer Swap TransferHandlerRegistry ERC1155TransferHandler ERC20TransferHandler ERC721TransferHandler KittyCoreTransferHandler flatten/Flattened.sol --network mainnet
```
@@ -6,5 +6,10 @@ import "@airswap/indexer/contracts/Indexer.sol";
import "@airswap/swap/contracts/Swap.sol";
import "@airswap/types/contracts/Types.sol";
import "@airswap/wrapper/contracts/Wrapper.sol";
import "@airswap/transfers/contracts/TransferHandlerRegistry.sol";
import "@airswap/transfers/contracts/handlers/ERC1155TransferHandler.sol";
import "@airswap/transfers/contracts/handlers/ERC20TransferHandler.sol";
import "@airswap/transfers/contracts/handlers/ERC721TransferHandler.sol";
import "@airswap/transfers/contracts/handlers/KittyCoreTransferHandler.sol";

contract Imports {}
@@ -1,26 +1,58 @@
require('dotenv').config();
var assert = require('assert');
const TransferHandlerRegistry = artifacts.require('TransferHandlerRegistry')
const ERC1155TransferHandler = artifacts.require('ERC1155TransferHandler')
const ERC20TransferHandler = artifacts.require('ERC20TransferHandler')
const ERC721TransferHandler = artifacts.require('ERC721TransferHandler')
const KittyCoreTransferHandler = artifacts.require('KittyCoreTransferHandler')
const Types = artifacts.require('Types');
const Swap = artifacts.require('Swap');
const Wrapper = artifacts.require('Wrapper');
const Indexer = artifacts.require('Indexer');
const Index = artifacts.require('Index');
const DelegateFactory = artifacts.require('DelegateFactory');
const PreSwapChecker = artifacts.require('PreSwapChecker');

const {
CK_INTERFACE_ID,
EMPTY_ADDRESS,
ERC20_INTERFACE_ID,
ERC721_INTERFACE_ID,
ERC1155_INTERFACE_ID
} = require('@airswap/order-utils').constants

module.exports = async(deployer, network) => {

network = network.toUpperCase()


let STAKING_TOKEN_ADDRESS = process.env[network + "_STAKE"]
let WETH_ADDRESS = process.env[network + "_WETH"]

//Deploy Base Contracts
//Deploy Base Contracts
await deployer.deploy(Types)
const transferHandlerRegistryInstance = await deployer.deploy(TransferHandlerRegistry)
// Deploy the transferHandlers referencesing the registry
await deployer.deploy(ERC1155TransferHandler)
await deployer.deploy(ERC721TransferHandler)
await deployer.deploy(ERC20TransferHandler)
await deployer.deploy(KittyCoreTransferHandler)
// link Types to Swap prior to deploy
await Swap.link("Types", Types.address)
await deployer.deploy(Swap)
await deployer.deploy(Indexer, STAKING_TOKEN_ADDRESS)
await deployer.deploy(DelegateFactory, Swap.address, Indexer.address, '0x0001')
await deployer.deploy(Swap, TransferHandlerRegistry.address)
const indexerInstance = await deployer.deploy(Indexer, STAKING_TOKEN_ADDRESS)
const delegateFactoryInstance = await deployer.deploy(DelegateFactory, Swap.address, Indexer.address, '0x0001')
await deployer.deploy(Wrapper, Swap.address, WETH_ADDRESS)

// link Types to Swap prior to deploy
await PreSwapChecker.link("Types", Types.address)
await deployer.deploy(PreSwapChecker, WETH_ADDRESS)
//Deploy Contract-Created Contracts that also need to be verified
await deployer.deploy(Index)
};
await indexerInstance.createIndex(WETH_ADDRESS, STAKING_TOKEN_ADDRESS,'0x0001')

await delegateFactoryInstance.createDelegate(EMPTY_ADDRESS)
// add the linkage between the handlers to the registry within the migration script
await transferHandlerRegistryInstance.addTransferHandler(CK_INTERFACE_ID, KittyCoreTransferHandler.address)
await transferHandlerRegistryInstance.addTransferHandler(ERC20_INTERFACE_ID, ERC20TransferHandler.address)
await transferHandlerRegistryInstance.addTransferHandler(ERC721_INTERFACE_ID, ERC721TransferHandler.address)
await transferHandlerRegistryInstance.addTransferHandler(ERC1155_INTERFACE_ID, ERC1155TransferHandler.address)
};
@@ -1,6 +1,6 @@
{
"name": "@airswap/deployer",
"version": "0.0.1",
"version": "0.1.2",
"description": "Tools to deploy AirSwap contracts",
"contributors": [
"Don Mosites <don.mosites@fluidity.io>",
@@ -24,12 +24,12 @@
},
"devDependencies": {
"@airswap/tokens": "0.1.4",
"@airswap/order-utils": "0.3.19",
"@airswap/order-utils": "0.3.20-beta.0",
"@airswap/test-utils": "0.1.4",
"solidity-docgen": "0.3.0-beta.3"
},
"dependencies": {
"@airswap/types": "2.4.5",
"@airswap/types": "3.5.5-beta.0",
"openzeppelin-solidity": "2.4"
}
}
@@ -14,10 +14,10 @@ module.exports = {
provider: () =>
new HDWalletProviderPriv(
[process.env.PRIVATE_KEY],
'https://mainnet.infura.io/v3/' + process.env.INFURA_API_KEY
process.env.MAINNET_NODE
),
gas: 7898551,
gasPrice: 10000000000, // CHECK THE CURRENT GASPRICE
gas: 5898551,
gasPrice: 5000000000, // CHECK THE CURRENT GASPRICE
network_id: 1,
},
rinkeby: {
@@ -28,7 +28,7 @@ module.exports = {
),
network_id: 4,
gas: 5898551,
gasPrice: 1900000000, // CHECK THE CURRENT GASPRICE
gasPrice: 1400000000, // CHECK THE CURRENT GASPRICE
},
},

@@ -1,6 +1,6 @@
{
"name": "@airswap/order-utils",
"version": "0.3.19",
"version": "0.3.20-beta.0",
"description": "JavaScript utilities for orders, hashes, and signatures on the AirSwap Network",
"contributors": [
"Don Mosites <don.mosites@fluidity.io>",
@@ -28,6 +28,7 @@ module.exports = {
ERC721_INTERFACE_ID: '0x80ac58cd',
ERC20_INTERFACE_ID: '0x36372b07',
ERC1155_INTERFACE_ID: '0xd9b67a26',
CK_INTERFACE_ID: '0x9a20483d',
GANACHE_PROVIDER: 'http://127.0.0.1:8545',
signatures: {
INTENDED_VALIDATOR: '0x00',

0 comments on commit 953956f

Please sign in to comment.
You can’t perform that action at this time.