Skip to content

Commit

Permalink
require check on transferFrom #91
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanrikulu committed Oct 17, 2023
1 parent ef391c1 commit 37a762b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/ERC20MultiDelegate.sol
Expand Up @@ -150,7 +150,7 @@ contract ERC20MultiDelegate is ERC1155, Ownable {
// Transfer the remaining source amount or the full source amount
// (if no remaining amount) to the delegator
address proxyAddressFrom = retrieveProxyContractAddress(token, source);
token.transferFrom(proxyAddressFrom, msg.sender, amount);
require(token.transferFrom(proxyAddressFrom, msg.sender, amount));
}

function setUri(string memory uri) external onlyOwner {
Expand All @@ -162,7 +162,7 @@ contract ERC20MultiDelegate is ERC1155, Ownable {
uint256 amount
) internal {
address proxyAddress = deployProxyDelegatorIfNeeded(target);
token.transferFrom(msg.sender, proxyAddress, amount);
require(token.transferFrom(msg.sender, proxyAddress, amount));
}

function transferBetweenDelegators(
Expand All @@ -172,7 +172,7 @@ contract ERC20MultiDelegate is ERC1155, Ownable {
) internal {
address proxyAddressFrom = retrieveProxyContractAddress(token, from);
address proxyAddressTo = retrieveProxyContractAddress(token, to);
token.transferFrom(proxyAddressFrom, proxyAddressTo, amount);
require(token.transferFrom(proxyAddressFrom, proxyAddressTo, amount));
}

function deployProxyDelegatorIfNeeded(
Expand Down Expand Up @@ -205,7 +205,7 @@ contract ERC20MultiDelegate is ERC1155, Ownable {
address _delegate
) private view returns (address) {
bytes memory bytecode = abi.encodePacked(
type(ERC20ProxyDelegator).creationCode,
type(ERC20ProxyDelegator).creationCode,
abi.encode(_token, _delegate)
);
bytes32 hash = keccak256(
Expand Down

0 comments on commit 37a762b

Please sign in to comment.