Skip to main content

Interactions

Contract origination

src/components/EditorBar.js line 42

const handleClick = () => {
///////////////////////////////////////////////////////////////////////////
// FIX ME
// Origination 'contract'
///////////////////////////////////////////////////////////////////////////
}
tezos.wallet.originate({
code: ZCBContractCode,
init: getStorage(
zcbState.contractInfo.issueraccount,
zcbState.contractInfo.subscriberaccount,
(parseInt(zcbState.contractInfo.faceprice)*1000000).toString(),
zcbState.contractInfo.discount,
"100",
(parseInt(zcbState.contractInfo.duration)*60).toString(),
(parseInt(zcbState.contractInfo.period)*60).toString())
}).send().then(op => {
console.log(`Waiting for confirmation of origination...`);
props.openSnack();
return op.contract()
}).then (contract => {
props.closeSnack();
setContractAddress(contract.address);
console.log(`Origination completed for ${contract.address}.`);
}).catch(error => console.log(`Error: ${JSON.stringify(error, null, 2)}`));