|
| 1 | +// SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | +/* |
| 3 | + This file is part of The Colony Network. |
| 4 | +
|
| 5 | + The Colony Network is free software: you can redistribute it and/or modify |
| 6 | + it under the terms of the GNU General Public License as published by |
| 7 | + the Free Software Foundation, either version 3 of the License, or |
| 8 | + (at your option) any later version. |
| 9 | +
|
| 10 | + The Colony Network is distributed in the hope that it will be useful, |
| 11 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + GNU General Public License for more details. |
| 14 | +
|
| 15 | + You should have received a copy of the GNU General Public License |
| 16 | + along with The Colony Network. If not, see <http://www.gnu.org/licenses/>. |
| 17 | +*/ |
| 18 | + |
| 19 | +pragma solidity 0.8.25; |
| 20 | +pragma experimental ABIEncoderV2; |
| 21 | + |
| 22 | +import { BasicMetaTransaction } from "./../common/BasicMetaTransaction.sol"; |
| 23 | +import { CallWithGuards } from "../common/CallWithGuards.sol"; |
| 24 | +import { ERC20Extended } from "./../common/ERC20Extended.sol"; |
| 25 | +import { Multicall } from "./../common/Multicall.sol"; |
| 26 | +import { IColonyNetwork } from "./../colonyNetwork/IColonyNetwork.sol"; |
| 27 | + |
| 28 | +contract ColonyShell is BasicMetaTransaction, Multicall, CallWithGuards { |
| 29 | + // Address of the Resolver contract used by EtherRouter for lookups and routing |
| 30 | + address resolver; // Storage slot 2 (from DSAuth there is authority and owner at storage slots 0 and 1 respectively) |
| 31 | + |
| 32 | + mapping(address => uint256) metatransactionNonces; |
| 33 | + |
| 34 | + function getMetatransactionNonce(address _user) public view override returns (uint256 _nonce) { |
| 35 | + return metatransactionNonces[_user]; |
| 36 | + } |
| 37 | + |
| 38 | + function incrementMetatransactionNonce(address _user) internal override { |
| 39 | + metatransactionNonces[_user] += 1; |
| 40 | + } |
| 41 | + |
| 42 | + // Public functions |
| 43 | + |
| 44 | + function claimColonyFunds(address _token) public { |
| 45 | + uint256 tokenBalance = (_token == address(0x0)) |
| 46 | + ? address(this).balance |
| 47 | + : ERC20Extended(_token).balanceOf(address(this)); |
| 48 | + |
| 49 | + IColonyNetwork(owner).sendClaimColonyFunds(_token, tokenBalance); |
| 50 | + |
| 51 | + emit ColonyFundsClaimed(_token, tokenBalance); |
| 52 | + } |
| 53 | + |
| 54 | + function transfer(address _token, address _user, uint256 _amount) public auth { |
| 55 | + ERC20Extended(_token).transfer(_user, _amount); |
| 56 | + |
| 57 | + emit PaymentMade(_token, _user, _amount); |
| 58 | + } |
| 59 | +} |
0 commit comments