Skip to content

Develop#5

Closed
coderwithattitude wants to merge 6 commits into
masterfrom
develop
Closed

Develop#5
coderwithattitude wants to merge 6 commits into
masterfrom
develop

Conversation

@coderwithattitude

Copy link
Copy Markdown
Contributor

debt Token deployer contract added.

function fetchDayTokens() onlyOwner public {
dayToken.transfer(owner, dayToken.balanceOf(this));
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add the fallback function, just to ensure that ether are not transferred to the address?

@kosecki123 kosecki123 Jan 11, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default fallback is not payable so TX with ETH will be reverted

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests for deployment code.

address user = msg.sender;

if(dayToken.transferFrom(user, this, dayTokenFees)){
DebtToken newDebtToken = new DebtToken(_tokenName, _tokenSymbol, _initialAmount, _exchangeRate,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When calling new DebtToken from DeployDebtToken the msg.sender seen by DebtToken will be the address of DeployDebtToken contract.

To fix this we shall modify the contract so it accepts 'borrower' as an input.

@adibas03 adibas03 Jan 17, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Observation, we would create a different DeployableDebtToken with that feature, so we can separate development process of the two.
Following the pattern used in the DayToken

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the way DayToken has resolved it. In case of debt contract, I think it has too much of overhead. If we "rename" owner to "borrower" there is no need for 3rd party like owner.

My proposal is to

  • add explicit argument to ctor borrower
  • remove owner variable and semantics and replace with borrower (remove ownable inheritance)

@kosecki123 kosecki123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modify the DebtToken contract so it get's the borrower as an input to the constructor.

@adibas03

adibas03 commented Jan 22, 2018

Copy link
Copy Markdown
Member

Closing in favour of #14
Will pull updates then resume branch

@adibas03 adibas03 closed this Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants