-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Defer loading SolidityContract (#132)
* Defer loading SolidityContract Defer loading SolidityContract Renamed getScheme to getContractWrapper Bumped version number Added forceReload to getWeb3 * removed foreceReload on getWeb3 * pull founders from json for migration * removed console.log * fix gas on forgeOrg * network-specific founders json fles * response to change requests * migration documentation * removed comments * updates to genesisProtocol params * added founders * modified travis build -- migration requires build * add all five founders to ganache Genesis migration * sync up ganache with ganacheDb accounts * try to fix travis build error * another try at travis * lint fix * private keys to addresses * back to Genesis for the DAO name
- Loading branch information
Showing
28 changed files
with
231 additions
and
151 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Deploying Contracts to a Specified Network | ||
|
||
To deploy contracts to a specified network, follow these steps: | ||
|
||
1) set the environment variable "network" to the name of the network ("ganache", "kovan", "live"). The default is "ganache". Truffle will use this to find the specified network settings in truffle.js. | ||
2) if needed, set `network`, and `gasLimit_deployment` in /config/default.json and run `npm start build` | ||
3) make sure that /migrations/founders.json has an entry for your network, with the appropriate founders | ||
4) run `npm start migrateContracts` | ||
|
||
Note: For safety, truffle.js specifies a different HTTP port for each network. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,36 @@ | ||
import { ExtendTruffleContract } from "ExtendTruffleContract"; | ||
import { Utils } from "./utils"; | ||
|
||
export default class ContractWrapperFactory<TContract extends ExtendTruffleContract> { | ||
|
||
constructor(private solidityContract: any, private wrapper: new (solidityContract: any) => TContract) { | ||
private solidityContract: any; | ||
|
||
/** | ||
* Instantiate a contract wrapper factory for the given wrapper class. | ||
* @param solidityContract Name of the contract | ||
* @param wrapper Class of the contract | ||
*/ | ||
public constructor(private solidityContractName: string, private wrapper: new (solidityContract: any) => TContract) { | ||
} | ||
|
||
public async new(...rest: Array<any>): Promise<TContract> { | ||
this.ensureSolidityContract(); | ||
return new this.wrapper(this.solidityContract).new(...rest); | ||
} | ||
|
||
public async at(address: string): Promise<TContract> { | ||
this.ensureSolidityContract(); | ||
return new this.wrapper(this.solidityContract).at(address); | ||
} | ||
|
||
public async deployed(): Promise<TContract> { | ||
this.ensureSolidityContract(); | ||
return new this.wrapper(this.solidityContract).deployed(); | ||
} | ||
|
||
private ensureSolidityContract(): void { | ||
if (!this.solidityContract) { | ||
this.solidityContract = Utils.requireContract(this.solidityContractName); | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.