Skip to content
This repository was archived by the owner on Dec 30, 2024. It is now read-only.

added any erc20 support to payments#37

Open
3esmit wants to merge 1 commit intoGiveth:developfrom
3esmit:erc20transfer
Open

added any erc20 support to payments#37
3esmit wants to merge 1 commit intoGiveth:developfrom
3esmit:erc20transfer

Conversation

@3esmit
Copy link
Copy Markdown

@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
Copy Markdown
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

Comment thread contracts/Escapable.sol
uint total = getBalance();
// Send the total balance of this contract to the `escapeHatchDestination`
transfer(escapeHatchDestination, total);
transfer(baseToken, escapeHatchDestination, total);
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.

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

Comment thread contracts/Escapable.sol
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
Copy Markdown
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

Comment thread contracts/Escapable.sol
uint total = getBalance();
// Send the total balance of this contract to the `escapeHatchDestination`
transfer(escapeHatchDestination, total);
transfer(baseToken, escapeHatchDestination, total);
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.

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

Comment thread contracts/Escapable.sol
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
Copy Markdown
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

Comment thread contracts/Vault.sol
function authorizePayment(
string _name,
bytes32 _reference,
address _token,
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.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants