Updates dai-plugin-mcd to mcd-v0.2.11. The main changes include:
lock
and wipe
with safeLock
and safeWipe
openLockAndDraw
for safer bag creationdrip()
calls were added to the contracts@makerdao/services-core
dependency, which has been moved into the monorepotest-helpers
packageMulticallService
, which will be used in the future for reducing network requests and keeping data up-to-date using Multicall
getPriceSync()
-> price
)test-helpers
packageManagedCdp.create
, getCdp
, and CdpTypeService.connect
wait for prefetching to complete@makerdao/services-core
dependency to match latest @makerdao/dai
releaseThe repo has been reorganized using lerna.
Breaking change: When importing a file directly from inside the package, the path now contains dist
.
// old
import addresses from `@makerdao/dai/contracts/addresses/kovan.json`
// new
import addresses from `@makerdao/dai/dist/contract/addresses/kovan.json`
All commits since last release (includes commits related to dai-plugin-mcd)
Miscellaneous small improvements and dependency upgrades
All commits since last release (includes commits related to dai-plugin-mcd)
This release updates the dai-plugin-mcd
package to MCD v0.2.10. The main change was adding the transferFrom
parameter to the lock
and lockAndDraw
gem functions.
However, it also revealed some bugs in handling tokens that don't support transferFrom
, like GNT. So the release also includes some expansion of the CdpManager
, which now allows for both GNT and DGD CDPs (in addition to the standard ERC20 gems that were already tested).
Most of the work since the last release has been in the MCD plugin, so there aren't many substantial changes here. The purpose of this release was to bump the versions of a few dependencies: in particular, web3
and @makerdao/services-core
.
Breaking change: This release extracts the exchange services (OasisExchangeService and Eth2DaiDirectService), which are now available as plugins. If you want to continue using either service, you'll need to install it separately and inject it into your configuration.
First, install:
$ yarn add @makerdao/dai-plugin-eth2dai-direct
Or:
$ yarn add @makerdao/dai-plugin-maker-otc
Then add it to your Maker instance:
import Maker from '@makerdao/dai';
import Eth2DaiDirect from '@makerdao/dai-plugin-eth2dai-direct';
async function createMakerAndSellEth(amount) {
const maker = await Maker.create('browser', {
plugins: [Eth2DaiDirect]
});
await maker.authenticate();
await maker.service('exchange').sell('ETH', 'DAI', amount);
}
Updates MCD contracts to v0.2.5 and other minor improvements
Updated ManagedCdp
to include the following functions: getCollateralAmount
, getCollateralizationRatio
, getLiquidationPrice
, isSafe
, minCollateral
, getCollateralAvailable
, getDaiAvailable
.
Included caching functionality to ManagedCdp and CDPType classes. In order to update the contract derived values, the reset
function can be called.