Skip to content

[AMM pool] Changed approvals + locking logic #1771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 21, 2020
11,101 changes: 5,542 additions & 5,559 deletions packages/loopring_v3/circuit/test/data/block.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ import "../../aux/compression/ZeroDecompressor.sol";
import "../../core/iface/IExchangeV3.sol";
import "../../thirdparty/BytesUtil.sol";
import "../../lib/AddressUtil.sol";
import "../../lib/ERC1271.sol";
import "../../lib/MathUint.sol";
import "../../lib/SignatureUtil.sol";
import "./SelectorBasedAccessManager.sol";
import "./IBlockReceiver.sol";


contract LoopringIOExchangeOwner is SelectorBasedAccessManager
contract LoopringIOExchangeOwner is SelectorBasedAccessManager, ERC1271
{
using AddressUtil for address;
using BytesUtil for bytes;
using MathUint for uint;
using AddressUtil for address;
using BytesUtil for bytes;
using MathUint for uint;
using SignatureUtil for bytes32;

bytes4 private constant SUBMITBLOCKS_SELECTOR = IExchangeV3.submitBlocks.selector;
bool public open;
Expand Down Expand Up @@ -76,6 +79,23 @@ contract LoopringIOExchangeOwner is SelectorBasedAccessManager
emit SubmitBlocksAccessOpened(_open);
}

function isValidSignature(
bytes32 signHash,
bytes memory signature
)
public
view
override
returns (bytes4)
{
// Role system used a bit differently here.
return hasAccessTo(
signHash.recoverECDSASigner(signature),
this.isValidSignature.selector
) ? ERC1271_MAGICVALUE : bytes4(0);
}


function processCallbacks(
ExchangeData.Block[] memory blocks,
BlockCallback[] calldata callbacks
Expand Down
Loading