Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Remove Token Counts #177

Merged
merged 6 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions contracts/ERC20Safe.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
contract ERC20Safe {
using SafeMath for uint256;

// ERC20 contract => amount of tokens owned by Safe
mapping(address => uint256) public _balances;

// ERC20 contract => amount of tokens burned by Safe
mapping(address => uint256) public _burnedTokens;
steviezhang marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -29,8 +26,6 @@ contract ERC20Safe {
function fundERC20(address tokenAddress, address owner, uint256 amount) public {
IERC20 erc20 = IERC20(tokenAddress);
_safeTransferFrom(erc20, owner, address(this), amount);

_balances[tokenAddress] = _balances[tokenAddress].add(amount);
}

/**
Expand All @@ -44,8 +39,6 @@ contract ERC20Safe {
function lockERC20(address tokenAddress, address owner, address recipient, uint256 amount) internal {
IERC20 erc20 = IERC20(tokenAddress);
_safeTransferFrom(erc20, owner, recipient, amount);

_balances[tokenAddress] = _balances[tokenAddress].add(amount);
}

/**
Expand All @@ -58,8 +51,6 @@ contract ERC20Safe {
function releaseERC20(address tokenAddress, address recipient, uint256 amount) internal {
IERC20 erc20 = IERC20(tokenAddress);
_safeTransfer(erc20, recipient, amount);

_balances[tokenAddress] = _balances[tokenAddress].sub(amount);
}

/**
Expand All @@ -73,9 +64,6 @@ contract ERC20Safe {
ERC20PresetMinterPauser erc20 = ERC20PresetMinterPauser(tokenAddress);
erc20.mint(recipient, amount);

if (address(this) == recipient) {
_balances[tokenAddress] = _balances[tokenAddress].add(amount);
}
}

/**
Expand Down
12 changes: 0 additions & 12 deletions contracts/ERC721Safe.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import "./ERC721MinterBurnerPauser.sol";
contract ERC721Safe {
using SafeMath for uint256;

// ERC721 contract => amount of tokens owned by Safe
mapping(address => uint256) public _balances;

// ERC721 contract => amount of tokens burned by Safe
mapping(address => uint256) public _burnedTokens;

Expand All @@ -28,8 +25,6 @@ contract ERC721Safe {
function fundERC721(address tokenAddress, address owner, uint tokenID) public {
IERC721 erc721 = IERC721(tokenAddress);
erc721.transferFrom(owner, address(this), tokenID);

_balances[tokenAddress] = _balances[tokenAddress].add(1);
}

/**
Expand All @@ -44,7 +39,6 @@ contract ERC721Safe {
IERC721 erc721 = IERC721(tokenAddress);
erc721.transferFrom(owner, recipient, tokenID);

_balances[tokenAddress] = _balances[tokenAddress].add(1);
}

/**
Expand All @@ -58,8 +52,6 @@ contract ERC721Safe {
function releaseERC721(address tokenAddress, address owner, address recipient, uint256 tokenID) internal {
IERC721 erc721 = IERC721(tokenAddress);
erc721.transferFrom(owner, recipient, tokenID);

_balances[tokenAddress] = _balances[tokenAddress].sub(1);
}

/**
Expand All @@ -73,10 +65,6 @@ contract ERC721Safe {
function mintERC721(address tokenAddress, address recipient, uint256 tokenID, bytes memory data) internal {
ERC721MinterBurnerPauser erc721 = ERC721MinterBurnerPauser(tokenAddress);
erc721.mint(recipient, tokenID, string(data));

if (address(this) == recipient) {
_balances[tokenAddress] = _balances[tokenAddress].add(1);
}
}

/**
Expand Down