Minor styling and naming changes
This commit is contained in:
parent
75a8b1c081
commit
ea8669439f
@ -41,7 +41,7 @@ library LibZeroExTransaction {
|
|||||||
struct ZeroExTransaction {
|
struct ZeroExTransaction {
|
||||||
uint256 salt; // Arbitrary number to ensure uniqueness of transaction hash.
|
uint256 salt; // Arbitrary number to ensure uniqueness of transaction hash.
|
||||||
uint256 expirationTimeSeconds; // Timestamp in seconds at which transaction expires.
|
uint256 expirationTimeSeconds; // Timestamp in seconds at which transaction expires.
|
||||||
uint256 gasPrice; // gasPrice at which transaction is required to be executed with.
|
uint256 gasPrice; // gasPrice that transaction is required to be executed with.
|
||||||
address signerAddress; // Address of transaction signer.
|
address signerAddress; // Address of transaction signer.
|
||||||
bytes data; // AbiV2 encoded calldata.
|
bytes data; // AbiV2 encoded calldata.
|
||||||
}
|
}
|
||||||
|
@ -120,14 +120,14 @@ contract MixinAssetProxyDispatcher is
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Call the asset proxy's transferFrom function with the constructed calldata.
|
// Call the asset proxy's transferFrom function with the constructed calldata.
|
||||||
(bool didSucceed, bytes memory revertData) = assetProxy.call(proxyCalldata);
|
(bool didSucceed, bytes memory returnData) = assetProxy.call(proxyCalldata);
|
||||||
|
|
||||||
// If the transaction did not succeed, revert with the returned data.
|
// If the transaction did not succeed, revert with the returned data.
|
||||||
if (!didSucceed) {
|
if (!didSucceed) {
|
||||||
LibRichErrors.rrevert(LibExchangeRichErrors.AssetProxyTransferError(
|
LibRichErrors.rrevert(LibExchangeRichErrors.AssetProxyTransferError(
|
||||||
orderHash,
|
orderHash,
|
||||||
assetData,
|
assetData,
|
||||||
revertData
|
returnData
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -483,7 +483,11 @@ contract MixinExchangeCore is
|
|||||||
if (address(this).balance >= protocolFee) {
|
if (address(this).balance >= protocolFee) {
|
||||||
valuePaid = protocolFee;
|
valuePaid = protocolFee;
|
||||||
}
|
}
|
||||||
IStaking(feeCollector).payProtocolFee.value(valuePaid)(order.makerAddress, takerAddress, protocolFee);
|
IStaking(feeCollector).payProtocolFee.value(valuePaid)(
|
||||||
|
order.makerAddress,
|
||||||
|
takerAddress,
|
||||||
|
protocolFee
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
fillResults.protocolFeePaid = 0;
|
fillResults.protocolFeePaid = 0;
|
||||||
}
|
}
|
||||||
|
@ -513,7 +513,11 @@ contract MixinMatchOrders is
|
|||||||
if (balance >= protocolFee) {
|
if (balance >= protocolFee) {
|
||||||
valuePaid = protocolFee;
|
valuePaid = protocolFee;
|
||||||
}
|
}
|
||||||
IStaking(feeCollector).payProtocolFee.value(valuePaid)(leftOrder.makerAddress, takerAddress, protocolFee);
|
IStaking(feeCollector).payProtocolFee.value(valuePaid)(
|
||||||
|
leftOrder.makerAddress,
|
||||||
|
takerAddress,
|
||||||
|
protocolFee
|
||||||
|
);
|
||||||
|
|
||||||
// Pay the right order's protocol fee.
|
// Pay the right order's protocol fee.
|
||||||
if (balance - valuePaid >= protocolFee) {
|
if (balance - valuePaid >= protocolFee) {
|
||||||
@ -521,7 +525,11 @@ contract MixinMatchOrders is
|
|||||||
} else {
|
} else {
|
||||||
valuePaid = 0;
|
valuePaid = 0;
|
||||||
}
|
}
|
||||||
IStaking(feeCollector).payProtocolFee.value(valuePaid)(rightOrder.makerAddress, takerAddress, protocolFee);
|
IStaking(feeCollector).payProtocolFee.value(valuePaid)(
|
||||||
|
rightOrder.makerAddress,
|
||||||
|
takerAddress,
|
||||||
|
protocolFee
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
matchedFillResults.left.protocolFeePaid = 0;
|
matchedFillResults.left.protocolFeePaid = 0;
|
||||||
matchedFillResults.right.protocolFeePaid = 0;
|
matchedFillResults.right.protocolFeePaid = 0;
|
||||||
|
@ -25,9 +25,9 @@ contract IEIP1271Wallet is
|
|||||||
LibEIP1271
|
LibEIP1271
|
||||||
{
|
{
|
||||||
/// @dev Verifies that a signature is valid.
|
/// @dev Verifies that a signature is valid.
|
||||||
/// @param data Arbitrary data.
|
/// @param data Arbitrary signed data.
|
||||||
/// @param signature Signature of `data`.
|
/// @param signature Proof that data has been signed.
|
||||||
/// @return magicValue .
|
/// @return magicValue bytes4(0x20c13b0b) if the signature check succeeds.
|
||||||
function isValidSignature(
|
function isValidSignature(
|
||||||
bytes calldata data,
|
bytes calldata data,
|
||||||
bytes calldata signature
|
bytes calldata signature
|
||||||
|
@ -41,7 +41,7 @@ contract ISignatureValidator {
|
|||||||
event SignatureValidatorApproval(
|
event SignatureValidatorApproval(
|
||||||
address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.
|
address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.
|
||||||
address indexed validatorAddress, // Address of signature validator contract.
|
address indexed validatorAddress, // Address of signature validator contract.
|
||||||
bool approved // Approval or disapproval of validator contract.
|
bool isApproved // Approval or disapproval of validator contract.
|
||||||
);
|
);
|
||||||
|
|
||||||
/// @dev Approves a hash on-chain.
|
/// @dev Approves a hash on-chain.
|
||||||
|
@ -1152,7 +1152,7 @@ blockchainTests.resets('MixinSignatureValidator', env => {
|
|||||||
const logArgs = log.args;
|
const logArgs = log.args;
|
||||||
expect(logArgs.signerAddress).to.equal(signerAddress);
|
expect(logArgs.signerAddress).to.equal(signerAddress);
|
||||||
expect(logArgs.validatorAddress).to.equal(validatorWallet.address);
|
expect(logArgs.validatorAddress).to.equal(validatorWallet.address);
|
||||||
expect(logArgs.approved).to.equal(approval);
|
expect(logArgs.isApproved).to.equal(approval);
|
||||||
});
|
});
|
||||||
it('should emit a SignatureValidatorApprovalSet with correct args when a validator is disapproved', async () => {
|
it('should emit a SignatureValidatorApprovalSet with correct args when a validator is disapproved', async () => {
|
||||||
const approval = false;
|
const approval = false;
|
||||||
@ -1170,7 +1170,7 @@ blockchainTests.resets('MixinSignatureValidator', env => {
|
|||||||
const logArgs = log.args;
|
const logArgs = log.args;
|
||||||
expect(logArgs.signerAddress).to.equal(signerAddress);
|
expect(logArgs.signerAddress).to.equal(signerAddress);
|
||||||
expect(logArgs.validatorAddress).to.equal(validatorWallet.address);
|
expect(logArgs.validatorAddress).to.equal(validatorWallet.address);
|
||||||
expect(logArgs.approved).to.equal(approval);
|
expect(logArgs.isApproved).to.equal(approval);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -611,7 +611,7 @@ blockchainTests.resets('Exchange transactions', env => {
|
|||||||
>).args;
|
>).args;
|
||||||
expect(validatorApprovalLogArgs.signerAddress).to.eq(takerAddress);
|
expect(validatorApprovalLogArgs.signerAddress).to.eq(takerAddress);
|
||||||
expect(validatorApprovalLogArgs.validatorAddress).to.eq(validatorAddress);
|
expect(validatorApprovalLogArgs.validatorAddress).to.eq(validatorAddress);
|
||||||
expect(validatorApprovalLogArgs.approved).to.eq(shouldApprove);
|
expect(validatorApprovalLogArgs.isApproved).to.eq(shouldApprove);
|
||||||
});
|
});
|
||||||
it('should approve a validator for the caller if called with no signature', async () => {
|
it('should approve a validator for the caller if called with no signature', async () => {
|
||||||
const shouldApprove = true;
|
const shouldApprove = true;
|
||||||
@ -633,7 +633,7 @@ blockchainTests.resets('Exchange transactions', env => {
|
|||||||
>).args;
|
>).args;
|
||||||
expect(validatorApprovalLogArgs.signerAddress).to.eq(takerAddress);
|
expect(validatorApprovalLogArgs.signerAddress).to.eq(takerAddress);
|
||||||
expect(validatorApprovalLogArgs.validatorAddress).to.eq(validatorAddress);
|
expect(validatorApprovalLogArgs.validatorAddress).to.eq(validatorAddress);
|
||||||
expect(validatorApprovalLogArgs.approved).to.eq(shouldApprove);
|
expect(validatorApprovalLogArgs.isApproved).to.eq(shouldApprove);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('batchExecuteTransactions', () => {
|
describe('batchExecuteTransactions', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user