diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-07-20 08:31:43 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-07-20 22:37:40 +0800 |
commit | 02d50a513af7981a1c7c04e05ce9bf3499b68c73 (patch) | |
tree | 8d18364a27de94da7efae6f7f0f1e4b780986b23 /packages/contracts/src | |
parent | d61759f6dd084e0aad0771f0261fc2a9fe2c06ed (diff) | |
download | dexon-sol-tools-02d50a513af7981a1c7c04e05ce9bf3499b68c73.tar dexon-sol-tools-02d50a513af7981a1c7c04e05ce9bf3499b68c73.tar.gz dexon-sol-tools-02d50a513af7981a1c7c04e05ce9bf3499b68c73.tar.bz2 dexon-sol-tools-02d50a513af7981a1c7c04e05ce9bf3499b68c73.tar.lz dexon-sol-tools-02d50a513af7981a1c7c04e05ce9bf3499b68c73.tar.xz dexon-sol-tools-02d50a513af7981a1c7c04e05ce9bf3499b68c73.tar.zst dexon-sol-tools-02d50a513af7981a1c7c04e05ce9bf3499b68c73.zip |
Hard code fillOrder selector into abiEncodeFillOrder
Diffstat (limited to 'packages/contracts/src')
-rw-r--r-- | packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol index 507e69712..704c7061c 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol @@ -24,10 +24,6 @@ import "./LibOrder.sol"; contract LibAbiEncoder { - // solhint-disable max-line-length - bytes4 constant internal FILL_ORDER_SELECTOR = bytes4(keccak256("fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)")); - // solhint-enable max-line-length - /// @dev ABI encodes calldata for `fillOrder` in memory and returns the address range. /// This range can be passed into `call` or `delegatecall` to invoke an external /// call to `fillOrder`. @@ -42,6 +38,7 @@ contract LibAbiEncoder { bytes memory signature ) public + pure returns (bytes memory fillOrderCalldata) { // We need to call MExchangeCore.fillOrder using a delegatecall in @@ -83,8 +80,6 @@ contract LibAbiEncoder { // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html - bytes4 fillOrderSelector = FILL_ORDER_SELECTOR; - assembly { // Areas below may use the following variables: @@ -99,8 +94,10 @@ contract LibAbiEncoder { /////// Setup Header Area /////// // Load free memory pointer fillOrderCalldata := mload(0x40) + // bytes4(keccak256("fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)")) + // = 0xb4be83d5 // Leave 0x20 bytes to store the length - mstore(add(fillOrderCalldata, 0x20), fillOrderSelector) + mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000) let headerAreaEnd := add(fillOrderCalldata, 0x24) /////// Setup Params Area /////// |