aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-06-08 02:11:40 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-06-08 06:39:40 +0800
commitf457a56d4a0a4e5a5b5b11289f65df64cf2c7f1f (patch)
treecb7b5a072cf546e132ed8e1ad4a7726474b339a0 /packages/contracts/src
parentdb086de84ae7a238b91b5ce79fcc1a8e4c830ac5 (diff)
downloaddexon-sol-tools-f457a56d4a0a4e5a5b5b11289f65df64cf2c7f1f.tar
dexon-sol-tools-f457a56d4a0a4e5a5b5b11289f65df64cf2c7f1f.tar.gz
dexon-sol-tools-f457a56d4a0a4e5a5b5b11289f65df64cf2c7f1f.tar.bz2
dexon-sol-tools-f457a56d4a0a4e5a5b5b11289f65df64cf2c7f1f.tar.lz
dexon-sol-tools-f457a56d4a0a4e5a5b5b11289f65df64cf2c7f1f.tar.xz
dexon-sol-tools-f457a56d4a0a4e5a5b5b11289f65df64cf2c7f1f.tar.zst
dexon-sol-tools-f457a56d4a0a4e5a5b5b11289f65df64cf2c7f1f.zip
Style updates to contracts
Diffstat (limited to 'packages/contracts/src')
-rw-r--r--packages/contracts/src/contracts/current/protocol/AssetProxy/ERC721Proxy.sol2
-rw-r--r--packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol28
-rw-r--r--packages/contracts/src/utils/artifacts.ts2
3 files changed, 16 insertions, 16 deletions
diff --git a/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC721Proxy.sol b/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC721Proxy.sol
index 499d8d96e..25136133d 100644
--- a/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC721Proxy.sol
+++ b/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC721Proxy.sol
@@ -116,7 +116,7 @@ contract ERC721Proxy is
if (length > 53) {
receiverData = readBytes(assetData, 52);
}
- proxyId = uint8(assetData[length-1]);
+ proxyId = uint8(assetData[length - 1]);
return (
proxyId,
diff --git a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol
index 8f6647d20..282455ea0 100644
--- a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol
+++ b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol
@@ -25,11 +25,11 @@ contract LibBytes is
{
// Revert reasons
- string constant GT_ZERO_LENGTH_REQUIRED = "Length must be greater than 0.";
- string constant GTE_4_LENGTH_REQUIRED = "Length must be greater than or equal to 4.";
- string constant GTE_20_LENGTH_REQUIRED = "Length must be greater than or equal to 20.";
- string constant GTE_32_LENGTH_REQUIRED = "Length must be greater than or equal to 32.";
- string constant INDEX_OUT_OF_BOUNDS = "Specified array index is out of bounds.";
+ string constant GREATER_THAN_ZERO_LENGTH_REQUIRED = "GREATER_THAN_ZERO_LENGTH_REQUIRED";
+ string constant GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED = "GREATER_THAN_4_LENGTH_REQUIRED";
+ string constant GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED = "GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED";
+ string constant GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED = "GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED";
+ string constant GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED = "GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED";
/// @dev Pops the last byte off of a byte array by modifying its length.
/// @param b Byte array that will be modified.
@@ -41,7 +41,7 @@ contract LibBytes is
{
require(
b.length > 0,
- GT_ZERO_LENGTH_REQUIRED
+ GREATER_THAN_ZERO_LENGTH_REQUIRED
);
// Store last byte.
@@ -65,7 +65,7 @@ contract LibBytes is
{
require(
b.length >= 20,
- GTE_20_LENGTH_REQUIRED
+ GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED
);
// Store last 20 bytes.
@@ -128,7 +128,7 @@ contract LibBytes is
{
require(
b.length >= index + 20, // 20 is length of address
- GTE_20_LENGTH_REQUIRED
+ GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED
);
// Add offset to index:
@@ -160,7 +160,7 @@ contract LibBytes is
{
require(
b.length >= index + 20, // 20 is length of address
- GTE_20_LENGTH_REQUIRED
+ GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED
);
// Add offset to index:
@@ -199,7 +199,7 @@ contract LibBytes is
{
require(
b.length >= index + 32,
- GTE_32_LENGTH_REQUIRED
+ GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED
);
// Arrays are prefixed by a 256 bit length parameter
@@ -226,7 +226,7 @@ contract LibBytes is
{
require(
b.length >= index + 32,
- GTE_32_LENGTH_REQUIRED
+ GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED
);
// Arrays are prefixed by a 256 bit length parameter
@@ -278,7 +278,7 @@ contract LibBytes is
{
require(
b.length >= 4,
- GTE_4_LENGTH_REQUIRED
+ GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED
);
assembly {
result := mload(add(b, 32))
@@ -306,7 +306,7 @@ contract LibBytes is
// length of nested bytes
require(
b.length >= index + nestedBytesLength,
- GTE_32_LENGTH_REQUIRED
+ GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED
);
// Allocate memory and copy value to result
@@ -336,7 +336,7 @@ contract LibBytes is
// length of input
require(
b.length >= index + 32 /* 32 bytes to store length */ + input.length,
- GTE_32_LENGTH_REQUIRED
+ GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED
);
// Copy <input> into <b>
diff --git a/packages/contracts/src/utils/artifacts.ts b/packages/contracts/src/utils/artifacts.ts
index 42de7c921..bf7221d6d 100644
--- a/packages/contracts/src/utils/artifacts.ts
+++ b/packages/contracts/src/utils/artifacts.ts
@@ -10,8 +10,8 @@ import * as Exchange from '../artifacts/Exchange.json';
import * as MixinAuthorizable from '../artifacts/MixinAuthorizable.json';
import * as MultiSigWallet from '../artifacts/MultiSigWallet.json';
import * as MultiSigWalletWithTimeLock from '../artifacts/MultiSigWalletWithTimeLock.json';
-import * as TestAssetProxyDispatcher from '../artifacts/TestAssetProxyDispatcher.json';
import * as TestAssetDataDecoders from '../artifacts/TestAssetDataDecoders.json';
+import * as TestAssetProxyDispatcher from '../artifacts/TestAssetProxyDispatcher.json';
import * as TestLibBytes from '../artifacts/TestLibBytes.json';
import * as TestLibMem from '../artifacts/TestLibMem.json';
import * as TestLibs from '../artifacts/TestLibs.json';