Add _ to remaining internal/private functions
This commit is contained in:
@@ -51,14 +51,14 @@ contract LibCoordinatorApproval is
|
||||
view
|
||||
returns (bytes32 approvalHash)
|
||||
{
|
||||
approvalHash = hashEIP712CoordinatorMessage(hashCoordinatorApproval(approval));
|
||||
approvalHash = _hashEIP712CoordinatorMessage(_hashCoordinatorApproval(approval));
|
||||
return approvalHash;
|
||||
}
|
||||
|
||||
/// @dev Calculated the EIP712 hash of the Coordinator approval mesasage with no domain separator.
|
||||
/// @param approval Coordinator approval message containing the transaction hash, transaction signature, and expiration of the approval.
|
||||
/// @return EIP712 hash of the Coordinator approval message with no domain separator.
|
||||
function hashCoordinatorApproval(CoordinatorApproval memory approval)
|
||||
function _hashCoordinatorApproval(CoordinatorApproval memory approval)
|
||||
internal
|
||||
pure
|
||||
returns (bytes32 result)
|
||||
|
||||
@@ -56,7 +56,7 @@ contract LibEIP712CoordinatorDomain is
|
||||
/// of this contract.
|
||||
/// @param hashStruct The EIP712 hash struct.
|
||||
/// @return EIP712 hash applied to this EIP712 Domain.
|
||||
function hashEIP712CoordinatorMessage(bytes32 hashStruct)
|
||||
function _hashEIP712CoordinatorMessage(bytes32 hashStruct)
|
||||
internal
|
||||
view
|
||||
returns (bytes32 result)
|
||||
|
||||
@@ -97,7 +97,7 @@ contract ERC1155 is
|
||||
emit TransferSingle(msg.sender, from, to, id, value);
|
||||
|
||||
// if `to` is a contract then trigger its callback
|
||||
if (to.isContract()) {
|
||||
if (to._isContract()) {
|
||||
bytes4 callbackReturnValue = IERC1155Receiver(to).onERC1155Received(
|
||||
msg.sender,
|
||||
from,
|
||||
@@ -177,7 +177,7 @@ contract ERC1155 is
|
||||
emit TransferBatch(msg.sender, from, to, ids, values);
|
||||
|
||||
// if `to` is a contract then trigger its callback
|
||||
if (to.isContract()) {
|
||||
if (to._isContract()) {
|
||||
bytes4 callbackReturnValue = IERC1155Receiver(to).onERC1155BatchReceived(
|
||||
msg.sender,
|
||||
from,
|
||||
|
||||
@@ -128,7 +128,7 @@ contract ERC1155Mintable is
|
||||
);
|
||||
|
||||
// if `to` is a contract then trigger its callback
|
||||
if (dst.isContract()) {
|
||||
if (dst._isContract()) {
|
||||
bytes4 callbackReturnValue = IERC1155Receiver(dst).onERC1155Received(
|
||||
msg.sender,
|
||||
msg.sender,
|
||||
@@ -177,7 +177,7 @@ contract ERC1155Mintable is
|
||||
emit TransferSingle(msg.sender, address(0x0), dst, id, 1);
|
||||
|
||||
// if `to` is a contract then trigger its callback
|
||||
if (dst.isContract()) {
|
||||
if (dst._isContract()) {
|
||||
bytes4 callbackReturnValue = IERC1155Receiver(dst).onERC1155Received(
|
||||
msg.sender,
|
||||
msg.sender,
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
|
||||
"files": [
|
||||
"generated-artifacts/LibAbiEncoder.json",
|
||||
"generated-artifacts/LibAssetProxyErrors.json",
|
||||
"generated-artifacts/LibConstants.json",
|
||||
"generated-artifacts/LibEIP712ExchangeDomain.json",
|
||||
"generated-artifacts/LibFillResults.json",
|
||||
|
||||
@@ -231,7 +231,7 @@ contract MixinExchangeCore is
|
||||
);
|
||||
|
||||
// Settle order
|
||||
settleOrder(
|
||||
_settleOrder(
|
||||
orderHash,
|
||||
order,
|
||||
takerAddress,
|
||||
@@ -499,7 +499,7 @@ contract MixinExchangeCore is
|
||||
/// @param order Order struct containing order specifications.
|
||||
/// @param takerAddress Address selling takerAsset and buying makerAsset.
|
||||
/// @param fillResults Amounts to be filled and fees paid by maker and taker.
|
||||
function settleOrder(
|
||||
function _settleOrder(
|
||||
bytes32 orderHash,
|
||||
LibOrder.Order memory order,
|
||||
address takerAddress,
|
||||
|
||||
@@ -124,7 +124,7 @@ contract MixinMatchOrders is
|
||||
);
|
||||
|
||||
// Settle matched orders. Succeeds or throws.
|
||||
settleMatchedOrders(
|
||||
_settleMatchedOrders(
|
||||
leftOrderInfo.orderHash,
|
||||
rightOrderInfo.orderHash,
|
||||
leftOrder,
|
||||
@@ -272,7 +272,7 @@ contract MixinMatchOrders is
|
||||
/// @param rightOrder Second matched order.
|
||||
/// @param takerAddress Address that matched the orders. The taker receives the spread between orders as profit.
|
||||
/// @param matchedFillResults Struct holding amounts to transfer between makers, taker, and fee recipients.
|
||||
function settleMatchedOrders(
|
||||
function _settleMatchedOrders(
|
||||
bytes32 leftOrderHash,
|
||||
bytes32 rightOrderHash,
|
||||
LibOrder.Order memory leftOrder,
|
||||
|
||||
@@ -136,7 +136,7 @@ contract MixinSignatureValidator is
|
||||
view
|
||||
returns (bool isValid)
|
||||
{
|
||||
SignatureType signatureType = readValidSignatureType(
|
||||
SignatureType signatureType = _readValidSignatureType(
|
||||
hash,
|
||||
signerAddress,
|
||||
signature
|
||||
@@ -152,7 +152,7 @@ contract MixinSignatureValidator is
|
||||
signature
|
||||
));
|
||||
}
|
||||
return validateHashSignatureTypes(
|
||||
return _validateHashSignatureTypes(
|
||||
signatureType,
|
||||
hash,
|
||||
signerAddress,
|
||||
@@ -177,14 +177,14 @@ contract MixinSignatureValidator is
|
||||
view
|
||||
returns (bool isValid)
|
||||
{
|
||||
SignatureType signatureType = readValidSignatureType(
|
||||
SignatureType signatureType = _readValidSignatureType(
|
||||
orderHash,
|
||||
signerAddress,
|
||||
signature
|
||||
);
|
||||
if (signatureType == SignatureType.OrderValidator) {
|
||||
// The entire order is verified by validator contract.
|
||||
isValid = validateOrderWithValidator(
|
||||
isValid = _validateOrderWithValidator(
|
||||
order,
|
||||
orderHash,
|
||||
signerAddress,
|
||||
@@ -193,7 +193,7 @@ contract MixinSignatureValidator is
|
||||
return isValid;
|
||||
} else if (signatureType == SignatureType.WalletOrderValidator) {
|
||||
// The entire order is verified by a wallet contract.
|
||||
isValid = validateOrderWithWallet(
|
||||
isValid = _validateOrderWithWallet(
|
||||
order,
|
||||
orderHash,
|
||||
signerAddress,
|
||||
@@ -202,7 +202,7 @@ contract MixinSignatureValidator is
|
||||
return isValid;
|
||||
}
|
||||
// Otherwise, it's one of the hash-compatible signature types.
|
||||
return validateHashSignatureTypes(
|
||||
return _validateHashSignatureTypes(
|
||||
signatureType,
|
||||
orderHash,
|
||||
signerAddress,
|
||||
@@ -211,7 +211,7 @@ contract MixinSignatureValidator is
|
||||
}
|
||||
|
||||
/// Reads the `SignatureType` from the end of a signature and validates it.
|
||||
function readValidSignatureType(
|
||||
function _readValidSignatureType(
|
||||
bytes32 hash,
|
||||
address signerAddress,
|
||||
bytes memory signature
|
||||
@@ -265,7 +265,7 @@ contract MixinSignatureValidator is
|
||||
/// and defines its own signature verification method.
|
||||
/// @param signature Proof that the hash has been signed by signer.
|
||||
/// @return True if the signature is validated by the Walidator.
|
||||
function validateHashWithWallet(
|
||||
function _validateHashWithWallet(
|
||||
bytes32 hash,
|
||||
address walletAddress,
|
||||
bytes memory signature
|
||||
@@ -310,7 +310,7 @@ contract MixinSignatureValidator is
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
/// @param signature Proof that the hash has been signed by signer.
|
||||
/// @return True if the signature is validated by the Validator.
|
||||
function validateHashWithValidator(
|
||||
function _validateHashWithValidator(
|
||||
bytes32 hash,
|
||||
address signerAddress,
|
||||
bytes memory signature
|
||||
@@ -370,7 +370,7 @@ contract MixinSignatureValidator is
|
||||
/// and defines its own order/signature verification method.
|
||||
/// @param signature Proof that the order has been signed by signer.
|
||||
/// @return True if order and signature are validated by the Wallet.
|
||||
function validateOrderWithWallet(
|
||||
function _validateOrderWithWallet(
|
||||
Order memory order,
|
||||
bytes32 orderHash,
|
||||
address walletAddress,
|
||||
@@ -418,7 +418,7 @@ contract MixinSignatureValidator is
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
/// @param signature Proof that the hash has been signed by signer.
|
||||
/// @return True if order and signature are validated by the Validator.
|
||||
function validateOrderWithValidator(
|
||||
function _validateOrderWithValidator(
|
||||
Order memory order,
|
||||
bytes32 orderHash,
|
||||
address signerAddress,
|
||||
@@ -473,7 +473,7 @@ contract MixinSignatureValidator is
|
||||
|
||||
/// Validates a hash-compatible signature type
|
||||
/// (anything but `OrderValidator` and `WalletOrderValidator`).
|
||||
function validateHashSignatureTypes(
|
||||
function _validateHashSignatureTypes(
|
||||
SignatureType signatureType,
|
||||
bytes32 hash,
|
||||
address signerAddress,
|
||||
@@ -549,7 +549,7 @@ contract MixinSignatureValidator is
|
||||
// Signature verified by wallet contract.
|
||||
// If used with an order, the maker of the order is the wallet contract.
|
||||
} else if (signatureType == SignatureType.Wallet) {
|
||||
isValid = validateHashWithWallet(
|
||||
isValid = _validateHashWithWallet(
|
||||
hash,
|
||||
signerAddress,
|
||||
signature
|
||||
@@ -559,7 +559,7 @@ contract MixinSignatureValidator is
|
||||
// Signature verified by validator contract.
|
||||
// If used with an order, the maker of the order can still be an EOA.
|
||||
} else if (signatureType == SignatureType.Validator) {
|
||||
isValid = validateHashWithValidator(
|
||||
isValid = _validateHashWithValidator(
|
||||
hash,
|
||||
signerAddress,
|
||||
signature
|
||||
|
||||
@@ -111,7 +111,7 @@ contract ReentrantERC20Token is
|
||||
callData = abi.encodeWithSelector(
|
||||
exchange.batchFillOrders.selector,
|
||||
orders,
|
||||
getTakerFillAmounts(orders),
|
||||
_getTakerFillAmounts(orders),
|
||||
_createWalletSignatures(BATCH_SIZE)
|
||||
);
|
||||
} else if (currentFunctionId == uint8(ExchangeFunction.BATCH_FILL_OR_KILL_ORDERS)) {
|
||||
@@ -119,7 +119,7 @@ contract ReentrantERC20Token is
|
||||
callData = abi.encodeWithSelector(
|
||||
exchange.batchFillOrKillOrders.selector,
|
||||
orders,
|
||||
getTakerFillAmounts(orders),
|
||||
_getTakerFillAmounts(orders),
|
||||
_createWalletSignatures(BATCH_SIZE)
|
||||
);
|
||||
} else if (currentFunctionId == uint8(ExchangeFunction.MARKET_BUY_ORDERS)) {
|
||||
@@ -139,7 +139,7 @@ contract ReentrantERC20Token is
|
||||
_createWalletSignatures(BATCH_SIZE)
|
||||
);
|
||||
} else if (currentFunctionId == uint8(ExchangeFunction.MATCH_ORDERS)) {
|
||||
LibOrder.Order[2] memory orders = createMatchedOrders();
|
||||
LibOrder.Order[2] memory orders = _createMatchedOrders();
|
||||
bytes[] memory signatures = _createWalletSignatures(2);
|
||||
callData = abi.encodeWithSelector(
|
||||
exchange.matchOrders.selector,
|
||||
@@ -232,7 +232,7 @@ contract ReentrantERC20Token is
|
||||
}
|
||||
|
||||
/// @dev Create two complementary test orders.
|
||||
function createMatchedOrders()
|
||||
function _createMatchedOrders()
|
||||
internal
|
||||
view
|
||||
returns (LibOrder.Order[2] memory orders)
|
||||
@@ -245,7 +245,7 @@ contract ReentrantERC20Token is
|
||||
orders[1].makerAssetAmount = orders[0].takerAssetAmount;
|
||||
}
|
||||
|
||||
function getTakerFillAmounts(
|
||||
function _getTakerFillAmounts(
|
||||
LibOrder.Order[] memory orders
|
||||
)
|
||||
internal
|
||||
|
||||
@@ -63,7 +63,7 @@ contract MixinBalanceThresholdFilterCore is
|
||||
external
|
||||
{
|
||||
// Get accounts whose balances must be validated
|
||||
address[] memory addressesToValidate = getAddressesToValidate(signerAddress);
|
||||
address[] memory addressesToValidate = _getAddressesToValidate(signerAddress);
|
||||
|
||||
// Validate account balances
|
||||
uint256 balanceThreshold = BALANCE_THRESHOLD;
|
||||
@@ -92,12 +92,12 @@ contract MixinBalanceThresholdFilterCore is
|
||||
/// (defined by `signedExchangeTransaction` above).
|
||||
/// @param signerAddress Address of transaction signer.
|
||||
/// @return addressesToValidate Array of addresses to validate.
|
||||
function getAddressesToValidate(address signerAddress)
|
||||
function _getAddressesToValidate(address signerAddress)
|
||||
internal
|
||||
pure
|
||||
returns (address[] memory addressesToValidate)
|
||||
{
|
||||
bytes4 exchangeFunctionSelector = bytes4(exchangeCalldataload(0));
|
||||
bytes4 exchangeFunctionSelector = bytes4(_exchangeCalldataload(0));
|
||||
// solhint-disable expression-indent
|
||||
if (
|
||||
exchangeFunctionSelector == BATCH_FILL_ORDERS_SELECTOR ||
|
||||
@@ -108,20 +108,20 @@ contract MixinBalanceThresholdFilterCore is
|
||||
exchangeFunctionSelector == MARKET_SELL_ORDERS_SELECTOR ||
|
||||
exchangeFunctionSelector == MARKET_SELL_ORDERS_NO_THROW_SELECTOR
|
||||
) {
|
||||
addressesToValidate = loadMakerAddressesFromOrderArray(0);
|
||||
addressesToValidate = _loadMakerAddressesFromOrderArray(0);
|
||||
addressesToValidate = addressesToValidate.append(signerAddress);
|
||||
} else if (
|
||||
exchangeFunctionSelector == FILL_ORDER_SELECTOR ||
|
||||
exchangeFunctionSelector == FILL_ORDER_NO_THROW_SELECTOR ||
|
||||
exchangeFunctionSelector == FILL_OR_KILL_ORDER_SELECTOR
|
||||
) {
|
||||
address makerAddress = loadMakerAddressFromOrder(0);
|
||||
address makerAddress = _loadMakerAddressFromOrder(0);
|
||||
addressesToValidate = addressesToValidate.append(makerAddress);
|
||||
addressesToValidate = addressesToValidate.append(signerAddress);
|
||||
} else if (exchangeFunctionSelector == MATCH_ORDERS_SELECTOR) {
|
||||
address leftMakerAddress = loadMakerAddressFromOrder(0);
|
||||
address leftMakerAddress = _loadMakerAddressFromOrder(0);
|
||||
addressesToValidate = addressesToValidate.append(leftMakerAddress);
|
||||
address rightMakerAddress = loadMakerAddressFromOrder(1);
|
||||
address rightMakerAddress = _loadMakerAddressFromOrder(1);
|
||||
addressesToValidate = addressesToValidate.append(rightMakerAddress);
|
||||
addressesToValidate = addressesToValidate.append(signerAddress);
|
||||
} else if (
|
||||
|
||||
@@ -33,7 +33,7 @@ contract MixinExchangeCalldata is
|
||||
/// which is accessed through `signedExchangeTransaction`.
|
||||
/// @param offset Offset into the Exchange calldata.
|
||||
/// @return value Corresponding 32 byte value stored at `offset`.
|
||||
function exchangeCalldataload(uint256 offset)
|
||||
function _exchangeCalldataload(uint256 offset)
|
||||
internal
|
||||
pure
|
||||
returns (bytes32 value)
|
||||
@@ -58,12 +58,12 @@ contract MixinExchangeCalldata is
|
||||
/// from the embedded Exchange calldata.
|
||||
/// @param offset Offset into the Exchange calldata (minus the 4 byte selector)
|
||||
/// @return value Corresponding 32 byte value stored at `offset` + 4.
|
||||
function loadExchangeData(uint256 offset)
|
||||
function _loadExchangeData(uint256 offset)
|
||||
internal
|
||||
pure
|
||||
returns (bytes32 value)
|
||||
{
|
||||
value = exchangeCalldataload(offset + 4);
|
||||
value = _exchangeCalldataload(offset + 4);
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -71,14 +71,14 @@ contract MixinExchangeCalldata is
|
||||
/// (which is embedded in `signedExchangeTransaction`).
|
||||
/// @param orderParamIndex Index of the order in the Exchange function's signature.
|
||||
/// @return makerAddress The extracted maker address.
|
||||
function loadMakerAddressFromOrder(uint256 orderParamIndex)
|
||||
function _loadMakerAddressFromOrder(uint256 orderParamIndex)
|
||||
internal
|
||||
pure
|
||||
returns (address makerAddress)
|
||||
{
|
||||
uint256 orderOffsetInBytes = orderParamIndex * 32;
|
||||
uint256 orderPtr = uint256(loadExchangeData(orderOffsetInBytes));
|
||||
makerAddress = address(uint256(loadExchangeData(orderPtr)));
|
||||
uint256 orderPtr = uint256(_loadExchangeData(orderOffsetInBytes));
|
||||
makerAddress = address(uint256(_loadExchangeData(orderPtr)));
|
||||
return makerAddress;
|
||||
}
|
||||
|
||||
@@ -86,20 +86,20 @@ contract MixinExchangeCalldata is
|
||||
/// (which is embedded in `signedExchangeTransaction`).
|
||||
/// @param orderArrayParamIndex Index of the order array in the Exchange function's signature
|
||||
/// @return makerAddresses The extracted maker addresses.
|
||||
function loadMakerAddressesFromOrderArray(uint256 orderArrayParamIndex)
|
||||
function _loadMakerAddressesFromOrderArray(uint256 orderArrayParamIndex)
|
||||
internal
|
||||
pure
|
||||
returns (address[] memory makerAddresses)
|
||||
{
|
||||
uint256 orderArrayOffsetInBytes = orderArrayParamIndex * 32;
|
||||
uint256 orderArrayPtr = uint256(loadExchangeData(orderArrayOffsetInBytes));
|
||||
uint256 orderArrayLength = uint256(loadExchangeData(orderArrayPtr));
|
||||
uint256 orderArrayPtr = uint256(_loadExchangeData(orderArrayOffsetInBytes));
|
||||
uint256 orderArrayLength = uint256(_loadExchangeData(orderArrayPtr));
|
||||
uint256 orderArrayLengthInBytes = orderArrayLength * 32;
|
||||
uint256 orderArrayElementPtr = orderArrayPtr + 32;
|
||||
uint256 orderArrayElementEndPtr = orderArrayElementPtr + orderArrayLengthInBytes;
|
||||
for (uint orderPtrOffset = orderArrayElementPtr; orderPtrOffset < orderArrayElementEndPtr; orderPtrOffset += 32) {
|
||||
uint256 orderPtr = uint256(loadExchangeData(orderPtrOffset));
|
||||
address makerAddress = address(uint256(loadExchangeData(orderPtr + orderArrayElementPtr)));
|
||||
uint256 orderPtr = uint256(_loadExchangeData(orderPtrOffset));
|
||||
address makerAddress = address(uint256(_loadExchangeData(orderPtr + orderArrayElementPtr)));
|
||||
makerAddresses = makerAddresses.append(makerAddress);
|
||||
}
|
||||
return makerAddresses;
|
||||
|
||||
@@ -48,7 +48,7 @@ contract MBalanceThresholdFilterCore is
|
||||
/// (defined by `signedExchangeTransaction` above).
|
||||
/// @param signerAddress Address of transaction signer.
|
||||
/// @return addressesToValidate Array of addresses to validate.
|
||||
function getAddressesToValidate(address signerAddress)
|
||||
function _getAddressesToValidate(address signerAddress)
|
||||
internal
|
||||
pure
|
||||
returns (address[] memory addressesToValidate);
|
||||
|
||||
@@ -26,7 +26,7 @@ contract MExchangeCalldata {
|
||||
/// which is accessed through `signedExchangeTransaction`.
|
||||
/// @param offset Offset into the Exchange calldata.
|
||||
/// @return value Corresponding 32 byte value stored at `offset`.
|
||||
function exchangeCalldataload(uint256 offset)
|
||||
function _exchangeCalldataload(uint256 offset)
|
||||
internal pure
|
||||
returns (bytes32 value);
|
||||
|
||||
@@ -34,7 +34,7 @@ contract MExchangeCalldata {
|
||||
/// from the embedded Exchange calldata.
|
||||
/// @param offset Offset into the Exchange calldata (minus the 4 byte selector)
|
||||
/// @return value Corresponding 32 byte value stored at `offset` + 4.
|
||||
function loadExchangeData(uint256 offset)
|
||||
function _loadExchangeData(uint256 offset)
|
||||
internal pure
|
||||
returns (bytes32 value);
|
||||
|
||||
@@ -42,7 +42,7 @@ contract MExchangeCalldata {
|
||||
/// (which is embedded in `signedExchangeTransaction`).
|
||||
/// @param orderParamIndex Index of the order in the Exchange function's signature.
|
||||
/// @return makerAddress The extracted maker address.
|
||||
function loadMakerAddressFromOrder(uint256 orderParamIndex)
|
||||
function _loadMakerAddressFromOrder(uint256 orderParamIndex)
|
||||
internal pure
|
||||
returns (address makerAddress);
|
||||
|
||||
@@ -50,7 +50,7 @@ contract MExchangeCalldata {
|
||||
/// (which is embedded in `signedExchangeTransaction`).
|
||||
/// @param orderArrayParamIndex Index of the order array in the Exchange function's signature
|
||||
/// @return makerAddresses The extracted maker addresses.
|
||||
function loadMakerAddressesFromOrderArray(uint256 orderArrayParamIndex)
|
||||
function _loadMakerAddressesFromOrderArray(uint256 orderArrayParamIndex)
|
||||
internal
|
||||
pure
|
||||
returns (address[] memory makerAddresses);
|
||||
|
||||
@@ -61,9 +61,9 @@ contract MixinAssets is
|
||||
bytes4 proxyId = assetData.readBytes4(0);
|
||||
|
||||
if (proxyId == ERC20_DATA_ID) {
|
||||
approveERC20Token(assetData, amount);
|
||||
_approveERC20Token(assetData, amount);
|
||||
} else if (proxyId == ERC721_DATA_ID) {
|
||||
approveERC721Token(assetData, amount);
|
||||
_approveERC721Token(assetData, amount);
|
||||
} else {
|
||||
revert("UNSUPPORTED_ASSET_PROXY");
|
||||
}
|
||||
@@ -166,7 +166,7 @@ contract MixinAssets is
|
||||
/// @dev Sets approval for ERC20 AssetProxy.
|
||||
/// @param assetData Byte array encoded for the respective asset proxy.
|
||||
/// @param amount Amount of asset to approve for respective proxy.
|
||||
function approveERC20Token(
|
||||
function _approveERC20Token(
|
||||
bytes memory assetData,
|
||||
uint256 amount
|
||||
)
|
||||
@@ -182,7 +182,7 @@ contract MixinAssets is
|
||||
/// @dev Sets approval for ERC721 AssetProxy.
|
||||
/// @param assetData Byte array encoded for the respective asset proxy.
|
||||
/// @param amount Amount of asset to approve for respective proxy.
|
||||
function approveERC721Token(
|
||||
function _approveERC721Token(
|
||||
bytes memory assetData,
|
||||
uint256 amount
|
||||
)
|
||||
|
||||
@@ -54,7 +54,7 @@ contract MAssets is
|
||||
/// @dev Sets approval for ERC20 AssetProxy.
|
||||
/// @param assetData Byte array encoded for the respective asset proxy.
|
||||
/// @param amount Amount of asset to approve for respective proxy.
|
||||
function approveERC20Token(
|
||||
function _approveERC20Token(
|
||||
bytes memory assetData,
|
||||
uint256 amount
|
||||
)
|
||||
@@ -63,7 +63,7 @@ contract MAssets is
|
||||
/// @dev Sets approval for ERC721 AssetProxy.
|
||||
/// @param assetData Byte array encoded for the respective asset proxy.
|
||||
/// @param amount Amount of asset to approve for respective proxy.
|
||||
function approveERC721Token(
|
||||
function _approveERC721Token(
|
||||
bytes memory assetData,
|
||||
uint256 amount
|
||||
)
|
||||
|
||||
@@ -98,7 +98,7 @@ contract AssetProxyOwner is
|
||||
{
|
||||
Transaction storage txn = transactions[transactionId];
|
||||
txn.executed = true;
|
||||
if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {
|
||||
if (_external_call(txn.destination, txn.value, txn.data.length, txn.data)) {
|
||||
emit Execution(transactionId);
|
||||
} else {
|
||||
emit ExecutionFailure(transactionId);
|
||||
|
||||
@@ -191,7 +191,7 @@ contract MultiSigWallet {
|
||||
public
|
||||
returns (uint transactionId)
|
||||
{
|
||||
transactionId = addTransaction(destination, value, data);
|
||||
transactionId = _addTransaction(destination, value, data);
|
||||
confirmTransaction(transactionId);
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ contract MultiSigWallet {
|
||||
if (isConfirmed(transactionId)) {
|
||||
Transaction storage txn = transactions[transactionId];
|
||||
txn.executed = true;
|
||||
if (external_call(txn.destination, txn.value, txn.data.length, txn.data))
|
||||
if (_external_call(txn.destination, txn.value, txn.data.length, txn.data))
|
||||
Execution(transactionId);
|
||||
else {
|
||||
ExecutionFailure(transactionId);
|
||||
@@ -242,7 +242,7 @@ contract MultiSigWallet {
|
||||
|
||||
// call has been separated into its own function in order to take advantage
|
||||
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
|
||||
function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {
|
||||
function _external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {
|
||||
bool result;
|
||||
assembly {
|
||||
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
|
||||
@@ -287,7 +287,7 @@ contract MultiSigWallet {
|
||||
/// @param value Transaction ether value.
|
||||
/// @param data Transaction data payload.
|
||||
/// @return Returns transaction ID.
|
||||
function addTransaction(address destination, uint value, bytes data)
|
||||
function _addTransaction(address destination, uint value, bytes data)
|
||||
internal
|
||||
notNull(destination)
|
||||
returns (uint transactionId)
|
||||
|
||||
@@ -95,7 +95,7 @@ contract MultiSigWalletWithTimeLock is
|
||||
confirmations[transactionId][msg.sender] = true;
|
||||
emit Confirmation(msg.sender, transactionId);
|
||||
if (isConfirmed(transactionId)) {
|
||||
setConfirmationTime(transactionId, block.timestamp);
|
||||
_setConfirmationTime(transactionId, block.timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ contract MultiSigWalletWithTimeLock is
|
||||
{
|
||||
Transaction storage txn = transactions[transactionId];
|
||||
txn.executed = true;
|
||||
if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) {
|
||||
if (_external_call(txn.destination, txn.value, txn.data.length, txn.data)) {
|
||||
emit Execution(transactionId);
|
||||
} else {
|
||||
emit ExecutionFailure(transactionId);
|
||||
@@ -118,7 +118,7 @@ contract MultiSigWalletWithTimeLock is
|
||||
}
|
||||
|
||||
/// @dev Sets the time of when a submission first passed.
|
||||
function setConfirmationTime(uint256 transactionId, uint256 confirmationTime)
|
||||
function _setConfirmationTime(uint256 transactionId, uint256 confirmationTime)
|
||||
internal
|
||||
{
|
||||
confirmationTimes[transactionId] = confirmationTime;
|
||||
|
||||
@@ -31,7 +31,7 @@ library Address {
|
||||
* @param account address of the account to check
|
||||
* @return whether the target address is a contract
|
||||
*/
|
||||
function isContract(address account) internal view returns (bool) {
|
||||
function _isContract(address account) internal view returns (bool) {
|
||||
uint256 size;
|
||||
// XXX Currently there is no better way to check if there is a contract in an address
|
||||
// than to check the size of the code at that address.
|
||||
|
||||
Reference in New Issue
Block a user