Skip to content

Commit

Permalink
return deploy args and address (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
martyall authored Apr 13, 2018
1 parent ced5f07 commit ab59fc2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Chanterelle/Internal/Deploy.purs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ deployContract
=> MonadAff (console :: CONSOLE, eth :: ETH, fs :: FS | eff) m
=> TransactionOptions NoPay
-> ContractConfig args
-> m Address
-> m {deployAddress :: Address, deployArgs :: Record args}
deployContract txOptions ccfg@{filepath, name, constructor} = do
(DeployConfig {provider, primaryAccount}) <- ask
validatedArgs <- validateDeployArgs ccfg
bytecode <- getContractBytecode ccfg
let deploymentAction = constructor txOptions bytecode validatedArgs
deployContractAndWriteToArtifact filepath name deploymentAction
deployAddress <- deployContractAndWriteToArtifact filepath name deploymentAction
pure {deployAddress, deployArgs: validatedArgs}

-- | Helper function which deploys a contract and writes the new contract address to the solc artifact.
deployContractAndWriteToArtifact
Expand Down

0 comments on commit ab59fc2

Please sign in to comment.