Skip to content

Commit

Permalink
Load both of contractAddress(DAI and cDAI) from ropsten.json
Browse files Browse the repository at this point in the history
  • Loading branch information
masaun committed Feb 9, 2020
1 parent a212256 commit 9211c96
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
16 changes: 8 additions & 8 deletions contracts/NewBancorPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import './bancor-protocol/converter/BancorFormula.sol';


// Compound and CToken
import "./compound-protocol/CErc20.sol";
//import "./compound-protocol/CErc20.sol";



Expand Down Expand Up @@ -112,13 +112,13 @@ contract NewBancorPool is BnStorage, BnConstants, Managed {
* @notice - Mint cToken (Compound Token)
* @dev - Reference from this link => https://compound.finance/developers/ctokens
***/
function mintCToken() public returns (bool) {
// [In progress]:
Erc20 underlying = Erc20(_ERC20tokenAddr); // get a handle for the underlying asset contract
CErc20 cToken = CErc20(cDAItokenAddr); // get a handle for the corresponding cToken contract
underlying.approve(address(cToken), 100); // approve the transfer
assert(cToken.mint(100) == 0); // mint the cTokens and assert there is no error
}
// function mintCToken() public returns (bool) {
// // [In progress]:
// Erc20 underlying = Erc20(_ERC20tokenAddr); // get a handle for the underlying asset contract
// CErc20 cToken = CErc20(cDAItokenAddr); // get a handle for the corresponding cToken contract
// underlying.approve(address(cToken), 100); // approve the transfer
// assert(cToken.mint(100) == 0); // mint the cTokens and assert there is no error
// }



Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 8 additions & 2 deletions migrations/6_deploy_new_bancor_pool.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
var NewBancorPool = artifacts.require("NewBancorPool");

var CompoundRopsten = require("../build_compound-protocol/networks/ropsten.json");


/***
* @notice - This is ContractAddress on Ropsten
* @ref - https://support.bancor.network/hc/en-us/articles/360010410399-Ethereum-Ropsten-Network-
* @ref - https://compound.finance/developers
**/
const _contractRegistry = '0x8a69A7d7507F8c4a9dD5dEB9B687B30D2b30A011'
const _BNTtoken = '0x9C7d1F4a027C64Af951858FD0F9CB3C91e008829'
const _ERC20token = '0xad6d458402f60fd3bd25163575031acdce07538d' // DAI on Ropsten
const _cDAI = '0x2b536482a01e620ee111747f8334b395a42a555e' // cDAI on Ropsten
const _ERC20token = CompoundRopsten['Contracts']['DAI'] // ContractAddress of DAI on Ropsten
const _cDAI = CompoundRopsten['Contracts']['cDAI'] // ContractAddress of cDAI on Ropsten
console.log('====== _ERC20token ===', _ERC20token);
console.log('====== _cDAI ===', _cDAI);


var SmartToken = artifacts.require("SmartToken")
//var BancorConverter = artifacts.require("BancorConverter")
Expand Down

0 comments on commit 9211c96

Please sign in to comment.