Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added any erc20 support to payments #37

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

3esmit
Copy link

@3esmit 3esmit commented Jun 21, 2017

Should fix #35.
Sorry for messing up in #36, I tried to fix it but github didn't updated the commits.

Copy link
Member

@GriffGreen GriffGreen left a comment

Choose a reason for hiding this comment

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

in general i think the better strategy is to keep the base token concept and add a second function for non base token transfers....

But this is a jordi call :-D

@@ -46,7 +46,7 @@ contract Escapable {
function escapeHatch() onlyEscapeHatchCaller {
uint total = getBalance();
// Send the total balance of this contract to the `escapeHatchDestination`
transfer(escapeHatchDestination, total);
transfer(baseToken, escapeHatchDestination, total);
Copy link
Member

Choose a reason for hiding this comment

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

This has it's own function and should not be added to the constructor

function transfer(address _to, uint _amount) internal {
if (address(baseToken) != 0) {
if (!baseToken.transfer(_to, _amount)) throw;
function transfer(address _token, address _to, uint _amount) internal {
Copy link
Member

Choose a reason for hiding this comment

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

We will have to ask jordi but i think the better design is to have a second function for this

@@ -46,7 +46,7 @@ contract Escapable {
function escapeHatch() onlyEscapeHatchCaller {
uint total = getBalance();
// Send the total balance of this contract to the `escapeHatchDestination`
transfer(escapeHatchDestination, total);
transfer(baseToken, escapeHatchDestination, total);
Copy link
Member

Choose a reason for hiding this comment

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

This has it's own function, see claimTokens which may need to be renamed

function transfer(address _to, uint _amount) internal {
if (address(baseToken) != 0) {
if (!baseToken.transfer(_to, _amount)) throw;
function transfer(address _token, address _to, uint _amount) internal {
Copy link
Member

Choose a reason for hiding this comment

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

This has it's own function, see claimTokens which may need to be renamed... Honestly i dont think this contract needs changes

@@ -204,6 +206,7 @@ contract Vault is Escapable, Owned {
function authorizePayment(
string _name,
bytes32 _reference,
address _token,
Copy link
Member

Choose a reason for hiding this comment

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

I think it is a better strategy to create a second function for non-baseToken transfers... but we need to hear from jordi... it might be a few days

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.

2 participants