Skip to content

Commit

Permalink
fix 0 fee transfer (#23)
Browse files Browse the repository at this point in the history
* minor fix fee 0

* deploy to bsc and polygon first
  • Loading branch information
Jarvis authored Aug 11, 2021
1 parent dab5725 commit 4796d7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"FetchTokenBalances": "0x813718C50df497BC136d5d6dfc0E0aDA8AB0C93e"
},
"bsc_mainnet": {
"smartWalletImplementation": "0x95ceC39Aa053C62d1A49D88B60620a489C241F53",
"smartWalletImplementation": "0x25750A5FED63A79ddE8E516f8A0D3C4EbA656F79",
"smartWalletProxy": "0x051DC16b2ECB366984d1074dCC07c342a9463999",
"fetchTokenBalances": "0xB8C6Ed80688a2674623D89A0AaBD3a87507B1868",
"fetchAaveDataWrapper": "0xE7314051BCFD832398e232f2c274278c44121a3f",
Expand Down Expand Up @@ -76,7 +76,7 @@
}
},
"polygon_mainnet": {
"smartWalletImplementation": "0xedE7cc39C5160d7DD82Eb5Ec71c63AEEe442cf32",
"smartWalletImplementation": "0x867eB83fEe136Be5b35d3554C89eC75D79737368",
"smartWalletProxy": "0x70270c228c5b4279d1578799926873aa72446ccd",
"fetchTokenBalances": "0xf351Dd5EC89e5ac6c9125262853c74E714C1d56a",
"fetchAaveDataWrapper": "0x8C27aBf05DE1d4847c3924566C3cBAFec6eFb42A",
Expand Down
6 changes: 4 additions & 2 deletions contracts/SmartWalletImplementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,9 @@ contract SmartWalletImplementation is SmartWalletStorage, ISmartWalletImplementa
if (from != address(this)) {
// case transfer from another address, need to transfer fee to this proxy contract
tokenErc.safeTransferFrom(from, to, amountAfterFee);
tokenErc.safeTransferFrom(from, address(this), fee);
if (fee > 0) {
tokenErc.safeTransferFrom(from, address(this), fee);
}
} else {
tokenErc.safeTransfer(to, amountAfterFee);
}
Expand All @@ -526,7 +528,7 @@ contract SmartWalletImplementation is SmartWalletStorage, ISmartWalletImplementa
}
}

function compareStrings(string memory a, string memory b) private view returns (bool) {
function compareStrings(string memory a, string memory b) private pure returns (bool) {
return (keccak256(abi.encodePacked((a))) == keccak256(abi.encodePacked((b))));
}
}

0 comments on commit 4796d7a

Please sign in to comment.