torn-token/contracts/mocks/ENSMock.sol

33 lines
805 B
Solidity
Raw Normal View History

2020-12-15 16:05:35 +01:00
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
contract ENSMock {
mapping(bytes32 => address) public registry;
function resolver(
bytes32 /* _node */
) external view returns (address) {
return address(this);
}
function addr(bytes32 _node) external view returns (address) {
return registry[_node];
}
function setAddr(bytes32 _node, address _addr) external {
registry[_node] = _addr;
}
function multicall(bytes[] calldata data) external returns (bytes[] memory results) {
results = new bytes[](data.length);
for (uint256 i = 0; i < data.length; i++) {
(bool success, bytes memory result) = address(this).delegatecall(data[i]);
require(success);
results[i] = result;
}
return results;
}
}