Skip to content
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

V0.3.7 patch04 deploy erc20 only for humans and orgs #50

Closed
Changes from all 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
10 changes: 4 additions & 6 deletions src/lift/ERC20Lift.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,20 @@ contract ERC20Lift is ProxyFactory, IERC20Lift, ICirclesErrors {
masterCopyERC20Wrapper[uint256(CirclesType.Inflation)] = _masterCopyERC20Inflation;
}

// External functions

// Public functions

function ensureERC20(address _avatar, CirclesType _circlesType) public returns (address) {
// todo: first build a simple proxy factory, afterwards redo for create2 deployment
// bytes32 salt = keccak256(abi.encodePacked(_id));
if (_circlesType != CirclesType.Demurrage && _circlesType != CirclesType.Inflation) {
// Must be a valid CirclesType.
revert CirclesInvalidParameter(uint256(_circlesType), 0);
}

if (msg.sender != address(hub)) {
// if the Hub calls it already has checked valid avatar
if (hub.avatars(_avatar) == address(0)) {
// Avatar must be registered.
// so when called independent from the Hub, check if the avatar
// is a registered human or group
if (!(hub.isHuman(_avatar) || hub.isGroup(_avatar))) {
// Avatar must be registered (as human or group)
revert CirclesAvatarMustBeRegistered(_avatar, 0);
}
}
Expand Down
Loading