Skip to content

Instantly share code, notes, and snippets.

@buddies2705
Created April 14, 2019 13:01
Show Gist options
  • Save buddies2705/2203c50bf59ff1210efd007b86dea5c0 to your computer and use it in GitHub Desktop.
Save buddies2705/2203c50bf59ff1210efd007b86dea5c0 to your computer and use it in GitHub Desktop.
dispatch(started());
const maker = Maker.create(process.env.REACT_APP_NETWORK, {
privateKey: process.env.REACT_APP_PRIVATE_KEY,
overrideMetamask: true,
provider: {
infuraProjectId
}
});
console.log('maker:', maker);
dispatch(makerCreated());
const cdp = await maker.openCdp();
console.log('cdp:', cdp);
dispatch(cdpOpened());
const lockEthTx = await cdp.lockEth(0.01);
console.log('transaction to lock eth:', lockEthTx);
dispatch(ethLocked());
await dispatch(drawDaiAsync(maker, cdp));
await dispatch(wipeDebtAsync(maker, cdp));
await dispatch(shutCdpAsync(cdp));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment