diff options
author | Hsuan Lee <boczeratul@gmail.com> | 2019-03-06 17:46:50 +0800 |
---|---|---|
committer | Hsuan Lee <boczeratul@gmail.com> | 2019-03-06 17:46:50 +0800 |
commit | 35703539d0f2b4ddb3b11d0de8c9634af59ab71f (patch) | |
tree | ae3731221dbbb3a6fa40060a8d916cfd3f738289 /packages/sol-doc/test/fixtures/contracts | |
parent | 92a1fde5b1ecd81b07cdb5bf0c9c1cd3544799db (diff) | |
download | dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.gz dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.bz2 dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.lz dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.xz dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.zst dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.zip |
Deploy @dexon-foundation/0x.jsstable
Diffstat (limited to 'packages/sol-doc/test/fixtures/contracts')
5 files changed, 0 insertions, 280 deletions
diff --git a/packages/sol-doc/test/fixtures/contracts/MultipleReturnValues.sol b/packages/sol-doc/test/fixtures/contracts/MultipleReturnValues.sol deleted file mode 100644 index 1e898622c..000000000 --- a/packages/sol-doc/test/fixtures/contracts/MultipleReturnValues.sol +++ /dev/null @@ -1,7 +0,0 @@ -pragma solidity ^0.4.24; - -contract MultipleReturnValues { - function methodWithMultipleReturnValues() public pure returns(int, int) { - return (0, 0); - } -} diff --git a/packages/sol-doc/test/fixtures/contracts/NatspecEverything.sol b/packages/sol-doc/test/fixtures/contracts/NatspecEverything.sol deleted file mode 100644 index c6ad3db81..000000000 --- a/packages/sol-doc/test/fixtures/contracts/NatspecEverything.sol +++ /dev/null @@ -1,40 +0,0 @@ -pragma solidity ^0.4.24; - -/// @title Contract Title -/// @dev This is a very long documentation comment at the contract level. -/// It actually spans multiple lines, too. -contract NatspecEverything { - int d; - - /// @dev Constructor @dev - /// @param p Constructor @param - constructor(int p) public { d = p; } - - /// @notice publicMethod @notice - /// @dev publicMethod @dev - /// @param p publicMethod @param - /// @return publicMethod @return - function publicMethod(int p) public pure returns(int r) { return p; } - - /// @dev Fallback @dev - function () public {} - - /// @notice externalMethod @notice - /// @dev externalMethod @dev - /// @param p externalMethod @param - /// @return externalMethod @return - function externalMethod(int p) external pure returns(int r) { return p; } - - /// @dev Here is a really long developer documentation comment, which spans - /// multiple lines, for the purposes of making sure that broken lines are - /// consolidated into one devdoc comment. - function methodWithLongDevdoc(int p) public pure returns(int) { return p; } - - /// @dev AnEvent @dev - /// @param p on this event is an integer. - event AnEvent(int p); - - /// @dev methodWithSolhintDirective @dev - // solhint-disable no-empty-blocks - function methodWithSolhintDirective() public pure {} -} diff --git a/packages/sol-doc/test/fixtures/contracts/StructParamAndReturn.sol b/packages/sol-doc/test/fixtures/contracts/StructParamAndReturn.sol deleted file mode 100644 index b9a7ccdbc..000000000 --- a/packages/sol-doc/test/fixtures/contracts/StructParamAndReturn.sol +++ /dev/null @@ -1,18 +0,0 @@ -pragma solidity 0.4.24; -pragma experimental ABIEncoderV2; - - -contract StructParamAndReturn { - - struct Stuff { - address anAddress; - uint256 aNumber; - } - - /// @dev DEV_COMMENT - /// @param stuff STUFF_COMMENT - /// @return RETURN_COMMENT - function methodWithStructParamAndReturn(Stuff stuff) public pure returns(Stuff) { - return stuff; - } -} diff --git a/packages/sol-doc/test/fixtures/contracts/TokenTransferProxy.sol b/packages/sol-doc/test/fixtures/contracts/TokenTransferProxy.sol deleted file mode 100644 index 44570d459..000000000 --- a/packages/sol-doc/test/fixtures/contracts/TokenTransferProxy.sol +++ /dev/null @@ -1,115 +0,0 @@ -/* - - Copyright 2018 ZeroEx Intl. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -*/ - -pragma solidity ^0.4.14; - -import { Ownable } from "zeppelin-solidity/contracts/ownership/Ownable.sol"; -import { ERC20 as Token } from "zeppelin-solidity/contracts/token/ERC20/ERC20.sol"; - -/// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance. -/// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com> -contract TokenTransferProxy is Ownable { - - /// @dev Only authorized addresses can invoke functions with this modifier. - modifier onlyAuthorized { - require(authorized[msg.sender]); - _; - } - - modifier targetAuthorized(address target) { - require(authorized[target]); - _; - } - - modifier targetNotAuthorized(address target) { - require(!authorized[target]); - _; - } - - mapping (address => bool) public authorized; - address[] public authorities; - - event LogAuthorizedAddressAdded(address indexed target, address indexed caller); - event LogAuthorizedAddressRemoved(address indexed target, address indexed caller); - - /* - * Public functions - */ - - /// @dev Authorizes an address. - /// @param target Address to authorize. - function addAuthorizedAddress(address target) - public - onlyOwner - targetNotAuthorized(target) - { - authorized[target] = true; - authorities.push(target); - LogAuthorizedAddressAdded(target, msg.sender); - } - - /// @dev Removes authorizion of an address. - /// @param target Address to remove authorization from. - function removeAuthorizedAddress(address target) - public - onlyOwner - targetAuthorized(target) - { - delete authorized[target]; - for (uint i = 0; i < authorities.length; i++) { - if (authorities[i] == target) { - authorities[i] = authorities[authorities.length - 1]; - authorities.length -= 1; - break; - } - } - LogAuthorizedAddressRemoved(target, msg.sender); - } - - /// @dev Calls into ERC20 Token contract, invoking transferFrom. - /// @param token Address of token to transfer. - /// @param from Address to transfer token from. - /// @param to Address to transfer token to. - /// @param value Amount of token to transfer. - /// @return Success of transfer. - function transferFrom( - address token, - address from, - address to, - uint value) - public - onlyAuthorized - returns (bool) - { - return Token(token).transferFrom(from, to, value); - } - - /* - * Public constant functions - */ - - /// @dev Gets all authorized addresses. - /// @return Array of authorized addresses. - function getAuthorizedAddresses() - public - constant - returns (address[]) - { - return authorities; - } -} diff --git a/packages/sol-doc/test/fixtures/contracts/TokenTransferProxyNoDevdoc.sol b/packages/sol-doc/test/fixtures/contracts/TokenTransferProxyNoDevdoc.sol deleted file mode 100644 index cc45a79e9..000000000 --- a/packages/sol-doc/test/fixtures/contracts/TokenTransferProxyNoDevdoc.sol +++ /dev/null @@ -1,100 +0,0 @@ -/* - - Copyright 2018 ZeroEx Intl. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -*/ - -pragma solidity ^0.4.14; - -import { Ownable } from "zeppelin-solidity/contracts/ownership/Ownable.sol"; -import { ERC20 as Token } from "zeppelin-solidity/contracts/token/ERC20/ERC20.sol"; - -contract TokenTransferProxyNoDevdoc is Ownable { - - modifier onlyAuthorized { - require(authorized[msg.sender]); - _; - } - - modifier targetAuthorized(address target) { - require(authorized[target]); - _; - } - - modifier targetNotAuthorized(address target) { - require(!authorized[target]); - _; - } - - mapping (address => bool) public authorized; - address[] public authorities; - - event LogAuthorizedAddressAdded(address indexed target, address indexed caller); - event LogAuthorizedAddressRemoved(address indexed target, address indexed caller); - - /* - * Public functions - */ - - function addAuthorizedAddress(address target) - public - onlyOwner - targetNotAuthorized(target) - { - authorized[target] = true; - authorities.push(target); - LogAuthorizedAddressAdded(target, msg.sender); - } - - function removeAuthorizedAddress(address target) - public - onlyOwner - targetAuthorized(target) - { - delete authorized[target]; - for (uint i = 0; i < authorities.length; i++) { - if (authorities[i] == target) { - authorities[i] = authorities[authorities.length - 1]; - authorities.length -= 1; - break; - } - } - LogAuthorizedAddressRemoved(target, msg.sender); - } - - function transferFrom( - address token, - address from, - address to, - uint value) - public - onlyAuthorized - returns (bool) - { - return Token(token).transferFrom(from, to, value); - } - - /* - * Public constant functions - */ - - function getAuthorizedAddresses() - public - constant - returns (address[]) - { - return authorities; - } -} |