-
Notifications
You must be signed in to change notification settings - Fork 30
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
Should fix #35.
Sorry for messing up in #36, I tried to fix it but github didn't updated the commits.