File size: 32,386 Bytes
f998fcd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
{
"language": "Solidity",
"sources": {
"/contracts/VaultV1.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nimport \"./interfaces/lightweight/IERC20.sol\";\r\nimport \"./interfaces/IFeeCollectorV1.sol\";\r\nimport \"./interfaces/ISignerVaultV1.sol\";\r\nimport \"./interfaces/ISignerVaultFactoryV1.sol\";\r\nimport \"./interfaces/IVaultV1.sol\";\r\nimport \"./library/TransferHelper.sol\";\r\n\r\ncontract VaultV1 is IVaultV1 {\r\n uint constant private UINT_MAX_VALUE = 2 ** 256 - 1;\r\n string constant private IDENTIFIER = \"Vault\";\r\n uint constant private VERSION = 1;\r\n\r\n address private immutable _deployer;\r\n Dependency[] _dependencies;\r\n\r\n address private _signerVaultFactory;\r\n address private _feeCollector;\r\n\r\n bool private _locked;\r\n\r\n constructor() {\r\n _deployer = msg.sender;\r\n _dependencies.push(Dependency(\"SignerVaultFactory\", 1));\r\n _dependencies.push(Dependency(\"FeeCollector\", 1));\r\n }\r\n\r\n receive() external payable { TransferHelper.safeTransferETH(_feeCollector, msg.value); }\r\n fallback() external payable { TransferHelper.safeTransferETH(_feeCollector, msg.value); }\r\n\r\n modifier lock() {\r\n require(!_locked, \"Vault: reentrancy\");\r\n _locked = true;\r\n _;\r\n _locked = false;\r\n }\r\n\r\n modifier onlyDeployer() {\r\n require(msg.sender == _deployer, \"Vault: caller must be the deployer\");\r\n _;\r\n }\r\n\r\n function ensureVault(address vault) private view {\r\n require(ISignerVaultFactoryV1(_signerVaultFactory).contains(vault), \"Vault: unknown vault\");\r\n require(ISignerVaultV1(vault).signer(msg.sender), \"Vault: caller must be a signer of the vault\");\r\n }\r\n\r\n function ensureFee(uint fee) private {\r\n require(msg.value >= fee, \"SignerVault: insufficient value\");\r\n if (fee > 0)\r\n IFeeCollectorV1(_feeCollector).payFee{ value: fee }(fee);\r\n if (msg.value > fee) \r\n TransferHelper.safeTransferETH(msg.sender, msg.value - fee);\r\n }\r\n\r\n function ensureFeeOnPartner(uint fee, address partner) private {\r\n require(msg.value >= fee, \"SignerVault: insufficient value\");\r\n if (fee > 0)\r\n IFeeCollectorV1(_feeCollector).payFeeOnPartner{ value: fee }(fee, partner);\r\n if (msg.value > fee) \r\n TransferHelper.safeTransferETH(msg.sender, msg.value - fee);\r\n }\r\n\r\n function ensureAmountAndFee(uint amount, uint fee) private {\r\n require(msg.value >= amount + fee, \"SignerVault: insufficient value\");\r\n if (fee > 0)\r\n IFeeCollectorV1(_feeCollector).payFee{ value: fee }(fee);\r\n if (msg.value > amount + fee) \r\n TransferHelper.safeTransferETH(msg.sender, msg.value - amount - fee);\r\n }\r\n\r\n function ensureAmountAndFeeOnPartner(uint amount, uint fee, address partner) private {\r\n require(msg.value >= amount + fee, \"SignerVault: insufficient value\");\r\n if (fee > 0)\r\n IFeeCollectorV1(_feeCollector).payFeeOnPartner{ value: fee }(fee, partner);\r\n if (msg.value > amount + fee) \r\n TransferHelper.safeTransferETH(msg.sender, msg.value - amount - fee);\r\n }\r\n\r\n function identifier() external pure returns (string memory) {\r\n return IDENTIFIER;\r\n }\r\n\r\n function version() external pure returns (uint) {\r\n return VERSION;\r\n }\r\n\r\n function dependencies() external view returns (Dependency[] memory) {\r\n return _dependencies;\r\n }\r\n\r\n function updateDependencies(Dependency[] calldata dependencies_) external onlyDeployer {\r\n delete _dependencies;\r\n for (uint index = 0; index < dependencies_.length; index++)\r\n _dependencies.push(dependencies_[index]);\r\n }\r\n\r\n function deployer() external view returns (address) {\r\n return _deployer;\r\n }\r\n\r\n function initialize(bytes calldata data) external onlyDeployer {\r\n address[] memory addresses = abi.decode(data, (address[]));\r\n address signerVaultFactory_ = addresses[0];\r\n address feeCollector_ = addresses[1];\r\n\r\n _signerVaultFactory = signerVaultFactory_;\r\n _feeCollector = feeCollector_;\r\n }\r\n\r\n function signerVaultFactory() external view returns (address) {\r\n return _signerVaultFactory;\r\n }\r\n\r\n function feeCollector() external view returns (address) {\r\n return _feeCollector;\r\n }\r\n\r\n function partnerOf(address partner) external view returns (uint) { return IFeeCollectorV1(_feeCollector).partnerOf(partner); }\r\n\r\n function fees() external view returns (Fees memory) { return IFeeCollectorV1(_feeCollector).fees(); }\r\n function fees(address signerVault) external view returns (Fees memory) { return IFeeCollectorV1(_feeCollector).fees(signerVault, msg.sender); }\r\n\r\n function vaults() external view returns (address[] memory) { return ISignerVaultFactoryV1(_signerVaultFactory).vaultsOf(msg.sender); }\r\n function vaultsLength() external view returns (uint) { return ISignerVaultFactoryV1(_signerVaultFactory).vaultsLengthOf(msg.sender); }\r\n function getVault(uint index) external view returns (address) { return ISignerVaultFactoryV1(_signerVaultFactory).getVaultOf(msg.sender, index); }\r\n\r\n function createVault() external lock returns (address) { return ISignerVaultFactoryV1(_signerVaultFactory).createVault(msg.sender); }\r\n\r\n function vote(address vault) external view returns (bytes memory data, uint quorom, uint accepts, uint rejects, bool voted) { (data, quorom, accepts, rejects, voted) = ISignerVaultV1(vault).vote(msg.sender); }\r\n function castVote(address vault, bool accept) external lock { ensureVault(vault); ISignerVaultV1(vault).castVote(accept, msg.sender); }\r\n\r\n function addSigner(address vault, address nominee) external lock { ensureVault(vault); ISignerVaultV1(vault).addSigner(nominee, msg.sender); }\r\n function removeSigner(address vault, address nominee) external lock { ensureVault(vault); ISignerVaultV1(vault).removeSigner(nominee, msg.sender); }\r\n\r\n function lockMapETH(address vault) external view returns (LockMap memory) { return ISignerVaultV1(vault).lockMapETH(); }\r\n function claimETH(address vault) external lock { ensureVault(vault); ISignerVaultV1(vault).claimETH(msg.sender); }\r\n function claimETH(address vault, address recipient) external lock { ensureVault(vault); ISignerVaultV1(vault).claimETH(recipient); }\r\n function unlockETH(address vault, uint amount) external lock { ensureVault(vault); ISignerVaultV1(vault).unlockETH(amount, msg.sender, msg.sender); }\r\n function unlockETH(address vault, uint amount, address recipient) external lock { ensureVault(vault); ISignerVaultV1(vault).unlockETH(amount, recipient, msg.sender); }\r\n function lockETH(address vault, uint amount, uint until) external payable { _lockETH(vault, amount, until, false, address(0)); }\r\n function lockETHOnPartner(address vault, uint amount, uint until, address partner) external payable { _lockETH(vault, amount, until, true, partner); }\r\n function lockETHPermanently(address vault, uint amount) external payable { _lockETH(vault, amount, UINT_MAX_VALUE, false, address(0)); }\r\n function lockETHPermanentlyOnPartner(address vault, uint amount, address partner) external payable { _lockETH(vault, amount, UINT_MAX_VALUE, true, partner); }\r\n\r\n function lockMapToken(address vault, address token) external view returns (LockMap memory) { return ISignerVaultV1(vault).lockMapToken(token); }\r\n function claimToken(address vault, address token) external lock { ensureVault(vault); ISignerVaultV1(vault).claimToken(token, msg.sender); }\r\n function claimToken(address vault, address token, address recipient) external lock { ensureVault(vault); ISignerVaultV1(vault).claimToken(token, recipient); }\r\n function unlockToken(address vault, address token, uint amount) external lock { ensureVault(vault); ISignerVaultV1(vault).unlockToken(token, amount, msg.sender, msg.sender); }\r\n function unlockToken(address vault, address token, uint amount, address recipient) external lock { ensureVault(vault); ISignerVaultV1(vault).unlockToken(token, amount, recipient, msg.sender); }\r\n function lockToken(address vault, address token, uint amount, uint until) external payable { _lockToken(vault, token, amount, until, false, address(0)); }\r\n function lockTokenOnPartner(address vault, address token, uint amount, uint until, address partner) external payable { _lockToken(vault, token, amount, until, true, partner); }\r\n function lockTokenPermanently(address vault, address token, uint amount) external payable { _lockToken(vault, token, amount, UINT_MAX_VALUE, false, address(0)); }\r\n function lockTokenPermanentlyOnPartner(address vault, address token, uint amount, address partner) external payable { _lockToken(vault, token, amount, UINT_MAX_VALUE, true, partner); }\r\n\r\n function lockMapERC721(address vault, address erc721) external view returns (LockMap memory) { return ISignerVaultV1(vault).lockMapERC721(erc721); }\r\n function claimERC721(address vault, address erc721, uint tokenId) external lock { ensureVault(vault); ISignerVaultV1(vault).claimERC721(erc721, tokenId, msg.sender); }\r\n function claimERC721(address vault, address erc721, uint tokenId, address recipient) external lock { ensureVault(vault); ISignerVaultV1(vault).claimERC721(erc721, tokenId, recipient); }\r\n function unlockERC721(address vault, address erc721, uint tokenId) external lock { ensureVault(vault); ISignerVaultV1(vault).unlockERC721(erc721, tokenId, msg.sender, msg.sender); }\r\n function unlockERC721(address vault, address erc721, uint tokenId, address recipient) external lock { ensureVault(vault); ISignerVaultV1(vault).unlockERC721(erc721, tokenId, recipient, msg.sender); }\r\n function lockERC721(address vault, address erc721, uint tokenId, uint until) external payable { _lockERC721(vault, erc721, tokenId, until, false, address(0)); }\r\n function lockERC721OnPartner(address vault, address erc721, uint tokenId, uint until, address partner) external payable { _lockERC721(vault, erc721, tokenId, until, true, partner); }\r\n function lockERC721Permanently(address vault, address erc721, uint tokenId) external payable { _lockERC721(vault, erc721, tokenId, UINT_MAX_VALUE, false, address(0)); }\r\n function lockERC721PermanentlyOnPartner(address vault, address erc721, uint tokenId, address partner) external payable { _lockERC721(vault, erc721, tokenId, UINT_MAX_VALUE, true, partner); }\r\n\r\n function swapLiquidity(address vault, address token, uint removeLiquidity, address[] calldata swapPath, uint deadline) external payable { _swapLiquidity(vault, token, removeLiquidity, 0, 0, 0, swapPath, 0, 0, deadline, false, address(0)); }\r\n function swapLiquidityOnPartner(address vault, address token, uint removeLiquidity, address[] calldata swapPath, uint deadline, address partner) external payable { _swapLiquidity(vault, token, removeLiquidity, 0, 0, 0, swapPath, 0, 0, deadline, true, partner); }\r\n function swapLiquidity(address vault, address token, uint removeLiquidity, uint swapAmountOutMin, address[] calldata swapPath, uint deadline) external payable { _swapLiquidity(vault, token, removeLiquidity, 0, 0, swapAmountOutMin, swapPath, 0, 0, deadline, false, address(0)); }\r\n function swapLiquidityOnPartner(address vault, address token, uint removeLiquidity, uint swapAmountOutMin, address[] calldata swapPath, uint deadline, address partner) external payable { _swapLiquidity(vault, token, removeLiquidity, 0, 0, swapAmountOutMin, swapPath, 0, 0, deadline, true, partner); }\r\n function swapLiquidity(address vault, address token, uint removeLiquidity, uint removeAmountAMin, uint removeAmountBMin, uint swapAmountOutMin, address[] calldata swapPath, uint addAmountAMin, uint addAmountBMin, uint deadline) external payable { _swapLiquidity(vault, token, removeLiquidity, removeAmountAMin, removeAmountBMin, swapAmountOutMin, swapPath, addAmountAMin, addAmountBMin, deadline, false, address(0)); }\r\n function swapLiquidityOnPartner(address vault, address token, uint removeLiquidity, uint removeAmountAMin, uint removeAmountBMin, uint swapAmountOutMin, address[] calldata swapPath, uint addAmountAMin, uint addAmountBMin, uint deadline, address partner) external payable { _swapLiquidity(vault, token, removeLiquidity, removeAmountAMin, removeAmountBMin, swapAmountOutMin, swapPath, addAmountAMin, addAmountBMin, deadline, true, partner); }\r\n\r\n function _lockETH(address vault, uint amount, uint until, bool onPartner, address partner) private lock {\r\n ensureVault(vault);\r\n\r\n if (onPartner)\r\n ensureAmountAndFeeOnPartner(amount, IFeeCollectorV1(_feeCollector).lockETHFee(vault, msg.sender), partner);\r\n else\r\n ensureAmountAndFee(amount, IFeeCollectorV1(_feeCollector).lockETHFee(vault, msg.sender));\r\n\r\n ISignerVaultV1(vault).lockETH{value:amount}(amount, until);\r\n }\r\n\r\n function _lockToken(address vault, address token, uint amount, uint until, bool onPartner, address partner) private lock {\r\n ensureVault(vault);\r\n\r\n if (onPartner)\r\n ensureFeeOnPartner(IFeeCollectorV1(_feeCollector).lockTokenFee(vault, msg.sender), partner);\r\n else\r\n ensureFee(IFeeCollectorV1(_feeCollector).lockTokenFee(vault, msg.sender));\r\n\r\n uint balanceBefore = IERC20(token).balanceOf(vault);\r\n TransferHelper.safeTransferFrom(token, msg.sender, vault, amount);\r\n amount = IERC20(token).balanceOf(vault) - balanceBefore;\r\n\r\n ISignerVaultV1(vault).lockToken(token, amount, until);\r\n }\r\n\r\n function _lockERC721(address vault, address erc721, uint tokenId, uint until, bool onPartner, address partner) private lock {\r\n ensureVault(vault);\r\n\r\n if (onPartner)\r\n ensureFeeOnPartner(IFeeCollectorV1(_feeCollector).lockERC721Fee(vault, msg.sender), partner);\r\n else\r\n ensureFee(IFeeCollectorV1(_feeCollector).lockERC721Fee(vault, msg.sender));\r\n\r\n TransferHelper.safeTransferFrom(erc721, msg.sender, vault, tokenId);\r\n\r\n ISignerVaultV1(vault).lockERC721(erc721, tokenId, until);\r\n }\r\n\r\n function _swapLiquidity(address vault, address token, uint removeLiquidity, uint removeAmountAMin, uint removeAmountBMin, uint swapAmountOutMin, address[] calldata swapPath, uint addAmountAMin, uint addAmountBMin, uint deadline, bool onPartner, address partner) private lock {\r\n ensureVault(vault);\r\n\r\n if (onPartner)\r\n ensureFeeOnPartner(IFeeCollectorV1(_feeCollector).lockERC721Fee(vault, msg.sender), partner);\r\n else\r\n ensureFee(IFeeCollectorV1(_feeCollector).swapLiquidityFee(vault, msg.sender));\r\n\r\n ISignerVaultV1(vault).swapLiquidity(token, removeLiquidity, removeAmountAMin, removeAmountBMin, swapAmountOutMin, swapPath, addAmountAMin, addAmountBMin, deadline);\r\n }\r\n}"
},
"/contracts/structs/Shareholders.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nstruct Shareholders {\r\n uint length;\r\n address[] addresses;\r\n uint[] shares;\r\n uint totalShares;\r\n}"
},
"/contracts/structs/LockMap.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nstruct LockMap {\r\n bool initialized;\r\n address id;\r\n uint length;\r\n uint[] untils;\r\n uint[] values;\r\n}"
},
"/contracts/structs/Fees.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nstruct Fees {\r\n uint lockETH;\r\n uint lockToken;\r\n uint lockERC721;\r\n uint swapLiquidity;\r\n}"
},
"/contracts/structs/Dependency.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nstruct Dependency {\r\n string identifier;\r\n uint version;\r\n}"
},
"/contracts/structs/Collaborations.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nimport \"./Fees.sol\";\r\n\r\nstruct Collaborations {\r\n uint length;\r\n address[] addresses;\r\n uint[] minBalances;\r\n Fees[] reductions;\r\n}"
},
"/contracts/library/TransferHelper.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0-or-later\r\npragma solidity >=0.6.0;\r\n\r\nlibrary TransferHelper {\r\n function safeApprove(address token, address to, uint value) internal {\r\n (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));\r\n require(success && (data.length == 0 || abi.decode(data, (bool))), \"TransferHelper: APPROVE_FAILED\");\r\n }\r\n\r\n function safeTransfer(address token, address to, uint value) internal {\r\n (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));\r\n require(success && (data.length == 0 || abi.decode(data, (bool))), \"TransferHelper: TRANSFER_FAILED\");\r\n }\r\n\r\n function safeTransferFrom(address token, address from, address to, uint value) internal {\r\n (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));\r\n require(success && (data.length == 0 || abi.decode(data, (bool))), \"TransferHelper: TRANSFER_FROM_FAILED\");\r\n }\r\n\r\n function safeTransferETH(address to, uint value) internal {\r\n (bool success,) = to.call{value:value}(new bytes(0));\r\n require(success, \"TransferHelper: TRANSFER_ETH_FAILED\");\r\n }\r\n}"
},
"/contracts/interfaces/lightweight/IERC721Receiver.sol": {
"content": "// lightweight version of @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\r\n\r\n// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721Receiver.sol)\r\n\r\npragma solidity ^0.8.0;\r\n\r\ninterface IERC721Receiver {\r\n function onERC721Received(\r\n address operator,\r\n address from,\r\n uint256 tokenId,\r\n bytes calldata data\r\n ) external returns (bytes4);\r\n}"
},
"/contracts/interfaces/lightweight/IERC20.sol": {
"content": "// lightweight version of @openzeppelin/contracts/token/ERC20/IERC20.sol\r\n\r\n// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\r\n\r\npragma solidity ^0.8.0;\r\n\r\ninterface IERC20 {\r\n function balanceOf(address account) external view returns (uint256);\r\n}"
},
"/contracts/interfaces/IVersion.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nimport \"../structs/Dependency.sol\";\r\n\r\ninterface IVersion {\r\n function identifier() external pure returns (string memory);\r\n function version() external pure returns (uint);\r\n\r\n function dependencies() external view returns (Dependency[] memory);\r\n function updateDependencies(Dependency[] calldata dependencies_) external;\r\n\r\n function deployer() external view returns (address);\r\n\r\n function initialize(bytes calldata data) external;\r\n}"
},
"/contracts/interfaces/IVaultV1.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nimport \"./IVersion.sol\";\r\nimport \"../structs/Fees.sol\";\r\nimport \"../structs/LockMap.sol\";\r\n\r\ninterface IVaultV1 is IVersion {\r\n function signerVaultFactory() external view returns (address);\r\n function feeCollector() external view returns (address);\r\n\r\n function partnerOf(address partner) external view returns (uint);\r\n\r\n function fees() external view returns (Fees memory);\r\n function fees(address vault) external view returns (Fees memory);\r\n\r\n function vaults() external view returns (address[] memory);\r\n function vaultsLength() external view returns (uint);\r\n function getVault(uint index) external view returns (address);\r\n\r\n function createVault() external returns (address);\r\n\r\n function vote(address vault) external view returns (bytes memory data, uint quorom, uint accepts, uint rejects, bool voted);\r\n function castVote(address vault, bool accept) external;\r\n\r\n function addSigner(address vault, address nominee) external;\r\n function removeSigner(address vault, address nominee) external;\r\n\r\n function lockMapETH(address vault) external view returns (LockMap memory);\r\n function claimETH(address vault) external;\r\n function claimETH(address vault, address recipient) external;\r\n function unlockETH(address vault, uint amount) external;\r\n function unlockETH(address vault, uint amount, address recipient) external;\r\n function lockETH(address vault, uint amount, uint until) external payable;\r\n function lockETHOnPartner(address vault, uint amount, uint until, address partner) external payable;\r\n function lockETHPermanently(address vault, uint amount) external payable;\r\n function lockETHPermanentlyOnPartner(address vault, uint amount, address partner) external payable;\r\n\r\n function lockMapToken(address vault, address token) external view returns (LockMap memory);\r\n function claimToken(address vault, address token) external;\r\n function claimToken(address vault, address token, address recipient) external;\r\n function unlockToken(address vault, address token, uint amount) external;\r\n function unlockToken(address vault, address token, uint amount, address recipient) external;\r\n function lockToken(address vault, address token, uint amount, uint until) external payable;\r\n function lockTokenOnPartner(address vault, address token, uint amount, uint until, address partner) external payable;\r\n function lockTokenPermanently(address vault, address token, uint amount) external payable;\r\n function lockTokenPermanentlyOnPartner(address vault, address token, uint amount, address partner) external payable;\r\n\r\n function lockMapERC721(address vault, address erc721) external view returns (LockMap memory);\r\n function claimERC721(address vault, address erc721, uint tokenId) external;\r\n function claimERC721(address vault, address erc721, uint tokenId, address recipient) external;\r\n function unlockERC721(address vault, address erc721, uint tokenId) external;\r\n function unlockERC721(address vault, address erc721, uint tokenId, address recipient) external;\r\n function lockERC721(address vault, address erc721, uint tokenId, uint until) external payable;\r\n function lockERC721OnPartner(address vault, address erc721, uint tokenId, uint until, address partner) external payable;\r\n function lockERC721Permanently(address vault, address erc721, uint tokenId) external payable;\r\n function lockERC721PermanentlyOnPartner(address vault, address erc721, uint tokenId, address partner) external payable;\r\n\r\n function swapLiquidity(address vault, address token, uint removeLiquidity, address[] calldata swapPath, uint deadline) external payable;\r\n function swapLiquidityOnPartner(address vault, address token, uint removeLiquidity, address[] calldata swapPath, uint deadline, address partner) external payable;\r\n function swapLiquidity(address vault, address token, uint removeLiquidity, uint swapAmountOutMin, address[] calldata swapPath, uint deadline) external payable;\r\n function swapLiquidityOnPartner(address vault, address token, uint removeLiquidity, uint swapAmountOutMin, address[] calldata swapPath, uint deadline, address partner) external payable;\r\n function swapLiquidity(address vault, address token, uint removeLiquidity, uint removeAmountAMin, uint removeAmountBMin, uint swapAmountOutMin, address[] calldata swapPath, uint addAmountAMin, uint addAmountBMin, uint deadline) external payable;\r\n function swapLiquidityOnPartner(address vault, address token, uint removeLiquidity, uint removeAmountAMin, uint removeAmountBMin, uint swapAmountOutMin, address[] calldata swapPath, uint addAmountAMin, uint addAmountBMin, uint deadline, address partner) external payable;\r\n}"
},
"/contracts/interfaces/ISignerVaultV1.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nimport \"./lightweight/IERC721Receiver.sol\";\r\nimport \"./IVersion.sol\";\r\nimport \"../structs/LockMap.sol\";\r\n\r\ninterface ISignerVaultV1 is IVersion, IERC721Receiver {\r\n event VoteOperationExecuted(bytes data, bool success, string revertReason);\r\n\r\n function initializeImplementation(address signerVaultFactory_, address signer_) external;\r\n\r\n function signerVaultFactory() external view returns (address);\r\n function signers() external view returns (address[] memory);\r\n function signer(address candidate) external view returns (bool);\r\n\r\n function vote(address voter) external view returns (bytes memory data, uint quorom, uint accepts, uint rejects, bool voted);\r\n function castVote(bool accept) external;\r\n function castVote(bool accept, address voter) external;\r\n\r\n function addSigner(address nominee) external;\r\n function addSigner(address nominee, address voter) external;\r\n function removeSigner(address nominee) external;\r\n function removeSigner(address nominee, address voter) external;\r\n\r\n function lockMapETH() external view returns (LockMap memory);\r\n function claimETH() external;\r\n function claimETH(address recipient) external;\r\n function unlockETH(uint amount) external;\r\n function unlockETH(uint amount, address recipient) external;\r\n function unlockETH(uint amount, address recipient, address voter) external;\r\n function lockETH(uint amount, uint until) external payable;\r\n function lockETHPermanently(uint amount) external payable;\r\n\r\n function lockMapToken(address token) external view returns (LockMap memory);\r\n function claimToken(address token) external;\r\n function claimToken(address token, address recipient) external;\r\n function unlockToken(address token, uint amount) external;\r\n function unlockToken(address token, uint amount, address recipient) external;\r\n function unlockToken(address token, uint amount, address recipient, address voter) external;\r\n function lockToken(address token, uint amount, uint until) external payable;\r\n function lockTokenPermanently(address token, uint amount) external payable;\r\n\r\n function lockMapERC721(address erc721) external view returns (LockMap memory);\r\n function claimERC721(address erc721, uint tokenId) external;\r\n function claimERC721(address erc721, uint tokenId, address recipient) external;\r\n function unlockERC721(address erc721, uint tokenId) external;\r\n function unlockERC721(address erc721, uint tokenId, address recipient) external;\r\n function unlockERC721(address erc721, uint tokenId, address recipient, address voter) external;\r\n function lockERC721(address erc721, uint tokenId, uint until) external payable;\r\n function lockERC721Permanently(address erc721, uint tokenId) external payable;\r\n\r\n function swapLiquidity(address token, uint removeLiquidity, address[] calldata swapPath, uint deadline) external payable;\r\n function swapLiquidity(address token, uint removeLiquidity, uint swapAmountOutMin, address[] calldata swapPath, uint deadline) external payable;\r\n function swapLiquidity(address token, uint removeLiquidity, uint removeAmountAMin, uint removeAmountBMin, uint swapAmountOutMin, address[] calldata swapPath, uint addAmountAMin, uint addAmountBMin, uint deadline) external payable;\r\n}"
},
"/contracts/interfaces/ISignerVaultFactoryV1.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nimport \"./IVersion.sol\";\r\n\r\ninterface ISignerVaultFactoryV1 is IVersion {\r\n event VaultCreated(address indexed signer, address vault, uint length, uint signerLength);\r\n\r\n function contractDeployer() external view returns (address);\r\n function feeCollector() external view returns (address);\r\n function vault() external view returns (address);\r\n function signerVault() external view returns (address);\r\n\r\n function contains(address vault_) external view returns (bool);\r\n\r\n function vaults() external view returns (address[] memory);\r\n function vaultsLength() external view returns (uint);\r\n function getVault(uint index) external view returns (address);\r\n\r\n function vaultsOf(address signer) external view returns (address[] memory);\r\n function vaultsLengthOf(address signer) external view returns (uint);\r\n function getVaultOf(address signer, uint index) external view returns (address);\r\n\r\n function createVault(address signer) external returns (address);\r\n\r\n function addLinking(address newSigner) external;\r\n function removeLinking(address oldSigner) external;\r\n}"
},
"/contracts/interfaces/IFeeCollectorV1.sol": {
"content": "// SPDX-License-Identifier: CC-BY-NC-4.0\r\n// Copyright (Ⓒ) 2022 Deathwing (https://github.com/Deathwing). All rights reserved\r\npragma solidity 0.8.16;\r\n\r\nimport \"./IVersion.sol\";\r\nimport \"../structs/Collaborations.sol\";\r\nimport \"../structs/Shareholders.sol\";\r\n\r\ninterface IFeeCollectorV1 is IVersion {\r\n function contractDeployer() external view returns (address);\r\n\r\n function shares() external view returns (Shareholders memory);\r\n function setShares(address shareholder, uint share) external;\r\n\r\n function reductions() external view returns (Collaborations memory);\r\n function setReductions(address collaboration, uint minBalance, Fees calldata reduction) external;\r\n\r\n function partnerOf(address partner) external view returns (uint);\r\n function setPartnerOf(address partner, uint fee) external;\r\n\r\n function exemptOf(address vaultOrSigner) external view returns (bool);\r\n function setExemptOf(address vaultOrSigner, bool exempt) external;\r\n\r\n function lockETHFee() external view returns (uint);\r\n function lockETHFee(address vault, address signer) external view returns (uint);\r\n function setLockETHFee(uint lockETHFee_) external;\r\n\r\n function lockTokenFee() external view returns (uint);\r\n function lockTokenFee(address vault, address signer) external view returns (uint);\r\n function setLockTokenFee(uint lockTokenFee_) external;\r\n\r\n function lockERC721Fee() external view returns (uint);\r\n function lockERC721Fee(address vault, address signer) external view returns (uint);\r\n function setLockERC721Fee(uint lockERC721Fee_) external;\r\n\r\n function swapLiquidityFee() external view returns (uint);\r\n function swapLiquidityFee(address vault, address signer) external view returns (uint);\r\n function setSwapLiquidityFee(uint swapLiquidityFee_) external;\r\n\r\n function fees() external view returns (Fees memory);\r\n function fees(address vault, address signer) external view returns (Fees memory);\r\n function setFees(Fees calldata fees_) external;\r\n\r\n function payFee(uint fee) external payable;\r\n function payFeeOnPartner(uint fee, address partner) external payable;\r\n}"
}
},
"settings": {
"remappings": [],
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "london",
"libraries": {},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
} |