aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/test/fixtures/contracts/base
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-01-25 23:42:58 +0800
committerFabio Berger <me@fabioberger.com>2018-01-25 23:42:58 +0800
commit71d68f975cd7bc089f0cbef4e5888a73eab4ee42 (patch)
tree9482602fc23d2baec3fff1fb97750ad45adc6eca /packages/deployer/test/fixtures/contracts/base
parentec3d8a034fe763d8255935985b1fb97aff6c177b (diff)
parentf58f0ddb67555c3f0c7252ea3e003824984c48ad (diff)
downloaddexon-sol-tools-71d68f975cd7bc089f0cbef4e5888a73eab4ee42.tar
dexon-sol-tools-71d68f975cd7bc089f0cbef4e5888a73eab4ee42.tar.gz
dexon-sol-tools-71d68f975cd7bc089f0cbef4e5888a73eab4ee42.tar.bz2
dexon-sol-tools-71d68f975cd7bc089f0cbef4e5888a73eab4ee42.tar.lz
dexon-sol-tools-71d68f975cd7bc089f0cbef4e5888a73eab4ee42.tar.xz
dexon-sol-tools-71d68f975cd7bc089f0cbef4e5888a73eab4ee42.tar.zst
dexon-sol-tools-71d68f975cd7bc089f0cbef4e5888a73eab4ee42.zip
Merge branch 'development' into feature/portal-ledger-support
* development: (437 commits) Publish Update yarn.lock Update the CHANGELOG Fix the bug making it impossible to specify the custom ZRX address Fix fill/cancel order by looking for NoError instead of empty blockchainErr given the BlockchainErrs type refactor Add a comment about a yarn bug Add our mainnet and kovan nodes as backups for Portal requests Fix bug hiding the user info from topBar Add dev-utils package to top level README Prettier newline Prettier Allow Token symbols to be alphanumeric Update CHANGELOG, rebase on development Should not -> cannot Reject negative amounts in isValidBaseUnitAmount Re-add changelog for 0x.js Fix prettier Update yarn.lock Move tests to a separate folder Change file layout ... # Conflicts: # packages/website/README.md
Diffstat (limited to 'packages/deployer/test/fixtures/contracts/base')
-rw-r--r--packages/deployer/test/fixtures/contracts/base/Ownable.sol27
-rw-r--r--packages/deployer/test/fixtures/contracts/base/SafeMath.sol41
-rw-r--r--packages/deployer/test/fixtures/contracts/base/Token.sol38
3 files changed, 106 insertions, 0 deletions
diff --git a/packages/deployer/test/fixtures/contracts/base/Ownable.sol b/packages/deployer/test/fixtures/contracts/base/Ownable.sol
new file mode 100644
index 000000000..2a74c3717
--- /dev/null
+++ b/packages/deployer/test/fixtures/contracts/base/Ownable.sol
@@ -0,0 +1,27 @@
+pragma solidity 0.4.14;
+
+/*
+ * Ownable
+ *
+ * Base contract with an owner.
+ * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
+ */
+
+contract Ownable {
+ address public owner;
+
+ function Ownable() {
+ owner = msg.sender;
+ }
+
+ modifier onlyOwner() {
+ require(msg.sender == owner);
+ _;
+ }
+
+ function transferOwnership(address newOwner) onlyOwner {
+ if (newOwner != address(0)) {
+ owner = newOwner;
+ }
+ }
+}
diff --git a/packages/deployer/test/fixtures/contracts/base/SafeMath.sol b/packages/deployer/test/fixtures/contracts/base/SafeMath.sol
new file mode 100644
index 000000000..7414684a8
--- /dev/null
+++ b/packages/deployer/test/fixtures/contracts/base/SafeMath.sol
@@ -0,0 +1,41 @@
+pragma solidity 0.4.14;
+
+contract SafeMath {
+ function safeMul(uint a, uint b) internal constant returns (uint256) {
+ uint c = a * b;
+ assert(a == 0 || c / a == b);
+ return c;
+ }
+
+ function safeDiv(uint a, uint b) internal constant returns (uint256) {
+ uint c = a / b;
+ return c;
+ }
+
+ function safeSub(uint a, uint b) internal constant returns (uint256) {
+ assert(b <= a);
+ return a - b;
+ }
+
+ function safeAdd(uint a, uint b) internal constant returns (uint256) {
+ uint c = a + b;
+ assert(c >= a);
+ return c;
+ }
+
+ function max64(uint64 a, uint64 b) internal constant returns (uint64) {
+ return a >= b ? a : b;
+ }
+
+ function min64(uint64 a, uint64 b) internal constant returns (uint64) {
+ return a < b ? a : b;
+ }
+
+ function max256(uint256 a, uint256 b) internal constant returns (uint256) {
+ return a >= b ? a : b;
+ }
+
+ function min256(uint256 a, uint256 b) internal constant returns (uint256) {
+ return a < b ? a : b;
+ }
+}
diff --git a/packages/deployer/test/fixtures/contracts/base/Token.sol b/packages/deployer/test/fixtures/contracts/base/Token.sol
new file mode 100644
index 000000000..c03f8c567
--- /dev/null
+++ b/packages/deployer/test/fixtures/contracts/base/Token.sol
@@ -0,0 +1,38 @@
+pragma solidity 0.4.14;
+
+contract Token {
+
+ /// @return total amount of tokens
+ function totalSupply() constant returns (uint supply) {}
+
+ /// @param _owner The address from which the balance will be retrieved
+ /// @return The balance
+ function balanceOf(address _owner) constant returns (uint balance) {}
+
+ /// @notice send `_value` token to `_to` from `msg.sender`
+ /// @param _to The address of the recipient
+ /// @param _value The amount of token to be transferred
+ /// @return Whether the transfer was successful or not
+ function transfer(address _to, uint _value) returns (bool success) {}
+
+ /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
+ /// @param _from The address of the sender
+ /// @param _to The address of the recipient
+ /// @param _value The amount of token to be transferred
+ /// @return Whether the transfer was successful or not
+ function transferFrom(address _from, address _to, uint _value) returns (bool success) {}
+
+ /// @notice `msg.sender` approves `_addr` to spend `_value` tokens
+ /// @param _spender The address of the account able to transfer the tokens
+ /// @param _value The amount of wei to be approved for transfer
+ /// @return Whether the approval was successful or not
+ function approve(address _spender, uint _value) returns (bool success) {}
+
+ /// @param _owner The address of the account owning tokens
+ /// @param _spender The address of the account able to transfer the tokens
+ /// @return Amount of remaining tokens allowed to spent
+ function allowance(address _owner, address _spender) constant returns (uint remaining) {}
+
+ event Transfer(address indexed _from, address indexed _to, uint _value);
+ event Approval(address indexed _owner, address indexed _spender, uint _value);
+}