Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
3d377974
Unverified
Commit
3d377974
authored
Jul 21, 2023
by
mergify[bot]
Committed by
GitHub
Jul 21, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into jm/vsc-settings
parents
663b74d6
ddaa2c53
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
474 additions
and
783 deletions
+474
-783
package.json
package.json
+1
-1
package.json
packages/chain-mon/package.json
+1
-0
package.json
packages/common-ts/package.json
+1
-0
Common.sol
packages/contracts-bedrock/contracts/EAS/Common.sol
+11
-28
EAS.sol
packages/contracts-bedrock/contracts/EAS/EAS.sol
+67
-144
IEAS.sol
packages/contracts-bedrock/contracts/EAS/IEAS.sol
+257
-346
ISchemaRegistry.sol
packages/contracts-bedrock/contracts/EAS/ISchemaRegistry.sol
+12
-26
SchemaRegistry.sol
packages/contracts-bedrock/contracts/EAS/SchemaRegistry.sol
+6
-17
EIP712Verifier.sol
...contracts-bedrock/contracts/EAS/eip712/EIP712Verifier.sol
+16
-34
ISchemaResolver.sol
...tracts-bedrock/contracts/EAS/resolver/ISchemaResolver.sol
+16
-34
SchemaResolver.sol
...ntracts-bedrock/contracts/EAS/resolver/SchemaResolver.sol
+24
-52
AssetReceiver.sol
...s/contracts-bedrock/contracts/periphery/AssetReceiver.sol
+38
-71
Transactor.sol
...ages/contracts-bedrock/contracts/periphery/Transactor.sol
+18
-30
package.json
packages/contracts-bedrock/package.json
+1
-0
package.json
packages/contracts-ts/package.json
+2
-0
package.json
packages/core-utils/package.json
+1
-0
package.json
packages/replica-healthcheck/package.json
+1
-0
package.json
packages/sdk/package.json
+1
-0
No files found.
package.json
View file @
3d377974
...
...
@@ -9,7 +9,7 @@
"pnpm"
:
">=8"
},
"scripts"
:
{
"clean"
:
"
npx nx run-many --target=clean
"
,
"clean"
:
"
pnpm recursive run clean; rm -rf node_modules packages/*/node_modules && echo 'Finished cleaning. Run `pnpm install && pnpm build` from root of repo to rebuild the repo.'
"
,
"bindings"
:
"nx bindings @eth-optimism/contracts-bedrock"
,
"build"
:
"npx nx run-many --target=build"
,
"test"
:
"npx nx run-many --target=test"
,
...
...
packages/chain-mon/package.json
View file @
3d377974
...
...
@@ -18,6 +18,7 @@
"test:coverage"
:
"nyc hardhat test && nyc merge .nyc_output coverage.json"
,
"build"
:
"tsc -p ./tsconfig.json"
,
"clean"
:
"rimraf dist/ ./tsconfig.tsbuildinfo"
,
"preinstall"
:
"npx only-allow pnpm"
,
"lint"
:
"pnpm lint:fix && pnpm lint:check"
,
"pre-commit"
:
"lint-staged"
,
"lint:fix"
:
"pnpm lint:check --fix"
,
...
...
packages/common-ts/package.json
View file @
3d377974
...
...
@@ -12,6 +12,7 @@
"all"
:
"pnpm clean && pnpm build && pnpm test && pnpm lint:fix && pnpm lint"
,
"build"
:
"tsc -p tsconfig.json"
,
"clean"
:
"rimraf dist/ ./tsconfig.tsbuildinfo"
,
"preinstall"
:
"npx only-allow pnpm"
,
"lint:check"
:
"eslint . --max-warnings=0"
,
"lint:fix"
:
"pnpm lint:check --fix"
,
"lint"
:
"pnpm lint:fix && pnpm lint:check"
,
...
...
packages/contracts-bedrock/contracts/EAS/Common.sol
View file @
3d377974
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// A representation of an empty/uninitialized UID.
...
...
@@ -14,18 +13,14 @@ error InvalidLength();
error InvalidSignature();
error NotFound();
/**
* @dev A struct representing EIP712 signature data.
*/
/// @dev A struct representing EIP712 signature data.
struct EIP712Signature {
uint8 v; // The recovery ID.
bytes32 r; // The x-coordinate of the nonce R.
bytes32 s; // The signature data.
}
/**
* @dev A struct representing a single attestation.
*/
/// @dev A struct representing a single attestation.
struct Attestation {
bytes32 uid; // A unique identifier of the attestation.
bytes32 schema; // The unique identifier of the schema.
...
...
@@ -42,26 +37,18 @@ struct Attestation {
// Maximum upgrade forward-compatibility storage gap.
uint32 constant MAX_GAP = 50;
/**
* @dev A helper function to work with unchecked iterators in loops.
*
* @param i The index to increment.
*
* @return j The incremented index.
*/
/// @dev A helper function to work with unchecked iterators in loops.
/// @param i The index to increment.
/// @return j The incremented index.
function uncheckedInc(uint256 i) pure returns (uint256 j) {
unchecked {
j = i + 1;
}
}
/**
* @dev A helper function that converts a string to a bytes32.
*
* @param str The string to convert.
*
* @return The converted bytes32.
*/
/// @dev A helper function that converts a string to a bytes32.
/// @param str The string to convert.
/// @return The converted bytes32.
function stringToBytes32(string memory str) pure returns (bytes32) {
bytes32 result;
...
...
@@ -72,13 +59,9 @@ function stringToBytes32(string memory str) pure returns (bytes32) {
return result;
}
/**
* @dev A helper function that converts a bytes32 to a string.
*
* @param data The bytes32 data to convert.
*
* @return The converted string.
*/
/// @dev A helper function that converts a bytes32 to a string.
/// @param data The bytes32 data to convert.
/// @return The converted string.
function bytes32ToString(bytes32 data) pure returns (string memory) {
bytes memory byteArray = new bytes(32);
...
...
packages/contracts-bedrock/contracts/EAS/EAS.sol
View file @
3d377974
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/contracts/EAS/IEAS.sol
View file @
3d377974
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/contracts/EAS/ISchemaRegistry.sol
View file @
3d377974
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ISchemaResolver } from "./resolver/ISchemaResolver.sol";
/**
* @title A struct representing a record for a submitted schema.
*/
/// @title A struct representing a record for a submitted schema.
struct SchemaRecord {
bytes32 uid; // The unique identifier of the schema.
ISchemaResolver resolver; // Optional schema resolver.
...
...
@@ -17,31 +14,20 @@ struct SchemaRecord {
/// @title ISchemaRegistry
/// @notice The interface of global attestation schemas for the Ethereum Attestation Service protocol.
interface ISchemaRegistry {
/**
* @dev Emitted when a new schema has been registered
*
* @param uid The schema UID.
* @param registerer The address of the account used to register the schema.
*/
/// @dev Emitted when a new schema has been registered
/// @param uid The schema UID.
/// @param registerer The address of the account used to register the schema.
event Registered(bytes32 indexed uid, address registerer);
/**
* @dev Submits and reserves a new schema
*
* @param schema The schema data schema.
* @param resolver An optional schema resolver.
* @param revocable Whether the schema allows revocations explicitly.
*
* @return The UID of the new schema.
*/
/// @dev Submits and reserves a new schema
/// @param schema The schema data schema.
/// @param resolver An optional schema resolver.
/// @param revocable Whether the schema allows revocations explicitly.
/// @return The UID of the new schema.
function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32);
/**
* @dev Returns an existing schema by UID
*
* @param uid The UID of the schema to retrieve.
*
* @return The schema data members.
*/
/// @dev Returns an existing schema by UID
/// @param uid The UID of the schema to retrieve.
/// @return The schema data members.
function getSchema(bytes32 uid) external view returns (SchemaRecord memory);
}
packages/contracts-bedrock/contracts/EAS/SchemaRegistry.sol
View file @
3d377974
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import { Semver } from "../universal/Semver.sol";
...
...
@@ -22,14 +21,10 @@ contract SchemaRegistry is ISchemaRegistry, Semver {
// Upgrade forward-compatibility storage gap
uint256[MAX_GAP - 1] private __gap;
/**
* @dev Creates a new SchemaRegistry instance.
*/
/// @dev Creates a new SchemaRegistry instance.
constructor() Semver(1, 0, 0) {}
/**
* @inheritdoc ISchemaRegistry
*/
/// @inheritdoc ISchemaRegistry
function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32) {
SchemaRecord memory schemaRecord = SchemaRecord({
uid: EMPTY_UID,
...
...
@@ -51,20 +46,14 @@ contract SchemaRegistry is ISchemaRegistry, Semver {
return uid;
}
/**
* @inheritdoc ISchemaRegistry
*/
/// @inheritdoc ISchemaRegistry
function getSchema(bytes32 uid) external view returns (SchemaRecord memory) {
return _registry[uid];
}
/**
* @dev Calculates a UID for a given schema.
*
* @param schemaRecord The input schema.
*
* @return schema UID.
*/
/// @dev Calculates a UID for a given schema.
/// @param schemaRecord The input schema.
/// @return schema UID.
function _getUID(SchemaRecord memory schemaRecord) private pure returns (bytes32) {
return keccak256(abi.encodePacked(schemaRecord.schema, schemaRecord.resolver, schemaRecord.revocable));
}
...
...
packages/contracts-bedrock/contracts/EAS/eip712/EIP712Verifier.sol
View file @
3d377974
...
...
@@ -36,59 +36,44 @@ abstract contract EIP712Verifier is EIP712 {
// Upgrade forward-compatibility storage gap
uint256[MAX_GAP - 1] private __gap;
/**
* @dev Creates a new EIP712Verifier instance.
*
* @param version The current major version of the signing domain
*/
/// @dev Creates a new EIP712Verifier instance.
/// @param version The current major version of the signing domain
constructor(string memory name, string memory version) EIP712(name, version) {
_name = stringToBytes32(name);
}
/**
* @dev Returns the domain separator used in the encoding of the signatures for attest, and revoke.
*/
/// @notice Returns the domain separator used in the encoding of the signatures for attest, and revoke.
function getDomainSeparator() external view returns (bytes32) {
return _domainSeparatorV4();
}
/**
* @dev Returns the current nonce per-account.
*
* @param account The requested account.
*
* @return The current nonce.
*/
/// @notice Returns the current nonce per-account.
/// @param account The requested account.
/// @return The current nonce.
function getNonce(address account) external view returns (uint256) {
return _nonces[account];
}
/**
* Returns the EIP712 type hash for the attest function.
*/
/// @notice Returns the EIP712 type hash for the attest function.
/// @return The EIP712 attest function type hash.
function getAttestTypeHash() external pure returns (bytes32) {
return ATTEST_TYPEHASH;
}
/**
* Returns the EIP712 type hash for the revoke function.
*/
/// @notice Returns the EIP712 type hash for the revoke function.
/// @return hash_ The EIP712 revoke function type hash.
function getRevokeTypeHash() external pure returns (bytes32) {
return REVOKE_TYPEHASH;
}
/**
* Returns the EIP712 name.
*/
/// @notice Returns the EIP712 name.
/// @return The EIP712 name.
function getName() external view returns (string memory) {
return bytes32ToString(_name);
}
/**
* @dev Verifies delegated attestation request.
*
* @param request The arguments of the delegated attestation request.
*/
/// @notice Verifies delegated attestation request.
/// @param request The arguments of the delegated attestation request.
function _verifyAttest(DelegatedAttestationRequest memory request) internal {
AttestationRequestData memory data = request.data;
EIP712Signature memory signature = request.signature;
...
...
@@ -118,11 +103,8 @@ abstract contract EIP712Verifier is EIP712 {
}
}
/**
* @dev Verifies delegated revocation request.
*
* @param request The arguments of the delegated revocation request.
*/
/// @notice Verifies delegated revocation request.
/// @param request The arguments of the delegated revocation request.
function _verifyRevoke(DelegatedRevocationRequest memory request) internal {
RevocationRequestData memory data = request.data;
EIP712Signature memory signature = request.signature;
...
...
packages/contracts-bedrock/contracts/EAS/resolver/ISchemaResolver.sol
View file @
3d377974
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { Attestation } from "../Common.sol";
...
...
@@ -7,50 +6,33 @@ import { Attestation } from "../Common.sol";
/// @title ISchemaResolver
/// @notice The interface of an optional schema resolver.
interface ISchemaResolver {
/**
* @dev Returns whether the resolver supports ETH transfers.
*/
/// @notice Checks if the resolve can be sent ETH.
/// @return Whether the resolver supports ETH transfers.
function isPayable() external pure returns (bool);
/**
* @dev Processes an attestation and verifies whether it's valid.
*
* @param attestation The new attestation.
*
* @return Whether the attestation is valid.
*/
/// @notice Processes an attestation and verifies whether it's valid.
/// @param attestation The new attestation.
/// @return Whether the attestation is valid.
function attest(Attestation calldata attestation) external payable returns (bool);
/**
* @dev Processes multiple attestations and verifies whether they are valid.
*
* @param attestations The new attestations.
* @param values Explicit ETH amounts which were sent with each attestation.
*
* @return Whether all the attestations are valid.
*/
/// @notice Processes multiple attestations and verifies whether they are valid.
/// @param attestations The new attestations.
/// @param values Explicit ETH amounts which were sent with each attestation.
/// @return Whether all the attestations are valid.
function multiAttest(
Attestation[] calldata attestations,
uint256[] calldata values
) external payable returns (bool);
/**
* @dev Processes an attestation revocation and verifies if it can be revoked.
*
* @param attestation The existing attestation to be revoked.
*
* @return Whether the attestation can be revoked.
*/
/// @notice Processes an attestation revocation and verifies if it can be revoked.
/// @param attestation The existing attestation to be revoked.
/// @return Whether the attestation can be revoked.
function revoke(Attestation calldata attestation) external payable returns (bool);
/**
* @dev Processes revocation of multiple attestation and verifies they can be revoked.
*
* @param attestations The existing attestations to be revoked.
* @param values Explicit ETH amounts which were sent with each revocation.
*
* @return Whether the attestations can be revoked.
*/
/// @notice Processes revocation of multiple attestation and verifies they can be revoked.
/// @param attestations The existing attestations to be revoked.
/// @param values Explicit ETH amounts which were sent with each revocation.
/// @return Whether the attestations can be revoked.
function multiRevoke(
Attestation[] calldata attestations,
uint256[] calldata values
...
...
packages/contracts-bedrock/contracts/EAS/resolver/SchemaResolver.sol
View file @
3d377974
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import { Semver } from "../../universal/Semver.sol";
...
...
@@ -19,11 +18,8 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
// The global EAS contract.
IEAS internal immutable _eas;
/**
* @dev Creates a new resolver.
*
* @param eas The address of the global EAS contract.
*/
/// @dev Creates a new resolver.
/// @param eas The address of the global EAS contract.
constructor(IEAS eas) Semver(1, 0, 0) {
if (address(eas) == address(0)) {
revert InvalidEAS();
...
...
@@ -32,41 +28,31 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
_eas = eas;
}
/**
* @dev Ensures that only the EAS contract can make this call.
*/
/// @dev Ensures that only the EAS contract can make this call.
modifier onlyEAS() {
_onlyEAS();
_;
}
/**
* @inheritdoc ISchemaResolver
*/
/// @inheritdoc ISchemaResolver
function isPayable() public pure virtual returns (bool) {
return false;
}
/**
* @dev ETH callback.
*/
/// @dev ETH callback.
receive() external payable virtual {
if (!isPayable()) {
revert NotPayable();
}
}
/**
* @inheritdoc ISchemaResolver
*/
/// @inheritdoc ISchemaResolver
function attest(Attestation calldata attestation) external payable onlyEAS returns (bool) {
return onAttest(attestation, msg.value);
}
/**
* @inheritdoc ISchemaResolver
*/
/// @inheritdoc ISchemaResolver
function multiAttest(
Attestation[] calldata attestations,
uint256[] calldata values
...
...
@@ -100,16 +86,12 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
return true;
}
/**
* @inheritdoc ISchemaResolver
*/
/// @inheritdoc ISchemaResolver
function revoke(Attestation calldata attestation) external payable onlyEAS returns (bool) {
return onRevoke(attestation, msg.value);
}
/**
* @inheritdoc ISchemaResolver
*/
/// @inheritdoc ISchemaResolver
function multiRevoke(
Attestation[] calldata attestations,
uint256[] calldata values
...
...
@@ -143,35 +125,25 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
return true;
}
/**
* @dev A resolver callback that should be implemented by child contracts.
*
* @param attestation The new attestation.
* @param value An explicit ETH amount that was sent to the resolver. Please note that this value is verified in
* both attest() and multiAttest() callbacks EAS-only callbacks and that in case of multi attestations, it'll
* usually hold that msg.value != value, since msg.value aggregated the sent ETH amounts for all the attestations
* in the batch.
*
* @return Whether the attestation is valid.
*/
/// @notice A resolver callback that should be implemented by child contracts.
/// @param attestation The new attestation.
/// @param value An explicit ETH amount that was sent to the resolver. Please note that this value is verified in
/// both attest() and multiAttest() callbacks EAS-only callbacks and that in case of multi attestations, it'll
/// usually hold that msg.value != value, since msg.value aggregated the sent ETH amounts for all the attestations
/// in the batch.
/// @return Whether the attestation is valid.
function onAttest(Attestation calldata attestation, uint256 value) internal virtual returns (bool);
/**
* @dev Processes an attestation revocation and verifies if it can be revoked.
*
* @param attestation The existing attestation to be revoked.
* @param value An explicit ETH amount that was sent to the resolver. Please note that this value is verified in
* both revoke() and multiRevoke() callbacks EAS-only callbacks and that in case of multi attestations, it'll
* usually hold that msg.value != value, since msg.value aggregated the sent ETH amounts for all the attestations
* in the batch.
*
* @return Whether the attestation can be revoked.
*/
/// @notice Processes an attestation revocation and verifies if it can be revoked.
/// @param attestation The existing attestation to be revoked.
/// @param value An explicit ETH amount that was sent to the resolver. Please note that this value is verified in
/// both revoke() and multiRevoke() callbacks EAS-only callbacks and that in case of multi attestations, it'll
/// usually hold that msg.value != value, since msg.value aggregated the sent ETH amounts for all the attestations
/// in the batch.
/// @return Whether the attestation can be revoked.
function onRevoke(Attestation calldata attestation, uint256 value) internal virtual returns (bool);
/**
* @dev Ensures that only the EAS contract can make this call.
*/
/// @notice Ensures that only the EAS contract can make this call.
function _onlyEAS() private view {
if (msg.sender != address(_eas)) {
revert AccessDenied();
...
...
packages/contracts-bedrock/contracts/periphery/AssetReceiver.sol
View file @
3d377974
...
...
@@ -5,37 +5,26 @@ import { ERC20 } from "@rari-capital/solmate/src/tokens/ERC20.sol";
import { ERC721 } from "@rari-capital/solmate/src/tokens/ERC721.sol";
import { Transactor } from "./Transactor.sol";
/**
* @title AssetReceiver
* @notice AssetReceiver is a minimal contract for receiving funds assets in the form of either
* ETH, ERC20 tokens, or ERC721 tokens. Only the contract owner may withdraw the assets.
*/
/// @title AssetReceiver
/// @notice AssetReceiver is a minimal contract for receiving funds assets in the form of either
/// ETH, ERC20 tokens, or ERC721 tokens. Only the contract owner may withdraw the assets.
contract AssetReceiver is Transactor {
/**
* @notice Emitted when ETH is received by this address.
*
* @param from Address that sent ETH to this contract.
* @param amount Amount of ETH received.
*/
/// @notice Emitted when ETH is received by this address.
/// @param from Address that sent ETH to this contract.
/// @param amount Amount of ETH received.
event ReceivedETH(address indexed from, uint256 amount);
/**
* @notice Emitted when ETH is withdrawn from this address.
*
* @param withdrawer Address that triggered the withdrawal.
* @param recipient Address that received the withdrawal.
* @param amount ETH amount withdrawn.
*/
/// @notice Emitted when ETH is withdrawn from this address.
/// @param withdrawer Address that triggered the withdrawal.
/// @param recipient Address that received the withdrawal.
/// @param amount ETH amount withdrawn.
event WithdrewETH(address indexed withdrawer, address indexed recipient, uint256 amount);
/**
* @notice Emitted when ERC20 tokens are withdrawn from this address.
*
* @param withdrawer Address that triggered the withdrawal.
* @param recipient Address that received the withdrawal.
* @param asset Address of the token being withdrawn.
* @param amount ERC20 amount withdrawn.
*/
/// @notice Emitted when ERC20 tokens are withdrawn from this address.
/// @param withdrawer Address that triggered the withdrawal.
/// @param recipient Address that received the withdrawal.
/// @param asset Address of the token being withdrawn.
/// @param amount ERC20 amount withdrawn.
event WithdrewERC20(
address indexed withdrawer,
address indexed recipient,
...
...
@@ -43,14 +32,11 @@ contract AssetReceiver is Transactor {
uint256 amount
);
/**
* @notice Emitted when ERC20 tokens are withdrawn from this address.
*
* @param withdrawer Address that triggered the withdrawal.
* @param recipient Address that received the withdrawal.
* @param asset Address of the token being withdrawn.
* @param id Token ID being withdrawn.
*/
/// @notice Emitted when ERC20 tokens are withdrawn from this address.
/// @param withdrawer Address that triggered the withdrawal.
/// @param recipient Address that received the withdrawal.
/// @param asset Address of the token being withdrawn.
/// @param id Token ID being withdrawn.
event WithdrewERC721(
address indexed withdrawer,
address indexed recipient,
...
...
@@ -58,56 +44,40 @@ contract AssetReceiver is Transactor {
uint256 id
);
/**
* @param _owner Initial contract owner.
*/
/// @param _owner Initial contract owner.
constructor(address _owner) Transactor(_owner) {}
/**
* @notice Make sure we can receive ETH.
*/
/// @notice Make sure we can receive ETH.
receive() external payable {
emit ReceivedETH(msg.sender, msg.value);
}
/**
* @notice Withdraws full ETH balance to the recipient.
*
* @param _to Address to receive the ETH balance.
*/
/// @notice Withdraws full ETH balance to the recipient.
/// @param _to Address to receive the ETH balance.
function withdrawETH(address payable _to) external onlyOwner {
withdrawETH(_to, address(this).balance);
}
/**
* @notice Withdraws partial ETH balance to the recipient.
*
* @param _to Address to receive the ETH balance.
* @param _amount Amount of ETH to withdraw.
*/
/// @notice Withdraws partial ETH balance to the recipient.
/// @param _to Address to receive the ETH balance.
/// @param _amount Amount of ETH to withdraw.
function withdrawETH(address payable _to, uint256 _amount) public onlyOwner {
// slither-disable-next-line reentrancy-unlimited-gas
(bool success, ) = _to.call{ value: _amount }("");
emit WithdrewETH(msg.sender, _to, _amount);
}
/**
* @notice Withdraws full ERC20 balance to the recipient.
*
* @param _asset ERC20 token to withdraw.
* @param _to Address to receive the ERC20 balance.
*/
/// @notice Withdraws full ERC20 balance to the recipient.
/// @param _asset ERC20 token to withdraw.
/// @param _to Address to receive the ERC20 balance.
function withdrawERC20(ERC20 _asset, address _to) external onlyOwner {
withdrawERC20(_asset, _to, _asset.balanceOf(address(this)));
}
/**
* @notice Withdraws partial ERC20 balance to the recipient.
*
* @param _asset ERC20 token to withdraw.
* @param _to Address to receive the ERC20 balance.
* @param _amount Amount of ERC20 to withdraw.
*/
/// @notice Withdraws partial ERC20 balance to the recipient.
/// @param _asset ERC20 token to withdraw.
/// @param _to Address to receive the ERC20 balance.
/// @param _amount Amount of ERC20 to withdraw.
function withdrawERC20(
ERC20 _asset,
address _to,
...
...
@@ -119,13 +89,10 @@ contract AssetReceiver is Transactor {
emit WithdrewERC20(msg.sender, _to, address(_asset), _amount);
}
/**
* @notice Withdraws ERC721 token to the recipient.
*
* @param _asset ERC721 token to withdraw.
* @param _to Address to receive the ERC721 token.
* @param _id Token ID of the ERC721 token to withdraw.
*/
/// @notice Withdraws ERC721 token to the recipient.
/// @param _asset ERC721 token to withdraw.
/// @param _to Address to receive the ERC721 token.
/// @param _id Token ID of the ERC721 token to withdraw.
function withdrawERC721(
ERC721 _asset,
address _to,
...
...
packages/contracts-bedrock/contracts/periphery/Transactor.sol
View file @
3d377974
...
...
@@ -3,50 +3,38 @@ pragma solidity ^0.8.0;
import { Owned } from "@rari-capital/solmate/src/auth/Owned.sol";
/**
* @title Transactor
* @notice Transactor is a minimal contract that can send transactions.
*/
/// @title Transactor
/// @notice Transactor is a minimal contract that can send transactions.
contract Transactor is Owned {
/**
* @param _owner Initial contract owner.
*/
/// @param _owner Initial contract owner.
constructor(address _owner) Owned(_owner) {}
/**
* Sends a CALL to a target address.
*
* @param _target Address to call.
* @param _data Data to send with the call.
* @param _value ETH value to send with the call.
*
* @return Boolean success value.
* @return Bytes data returned by the call.
*/
/// @notice Sends a CALL to a target address.
/// @param _target Address to call.
/// @param _data Data to send with the call.
/// @param _value ETH value to send with the call.
/// @return success_ Boolean success value.
/// @return data_ Bytes data returned by the call.
function CALL(
address _target,
bytes memory _data,
uint256 _value
) external payable onlyOwner returns (bool
, bytes memory
) {
return
_target.call{ value: _value }(_data);
) external payable onlyOwner returns (bool
success_, bytes memory data_
) {
(success_, data_) =
_target.call{ value: _value }(_data);
}
/**
* Sends a DELEGATECALL to a target address.
*
* @param _target Address to call.
* @param _data Data to send with the call.
*
* @return Boolean success value.
* @return Bytes data returned by the call.
*/
/// @notice Sends a DELEGATECALL to a target address.
/// @param _target Address to call.
/// @param _data Data to send with the call.
/// @return success_ Boolean success value.
/// @return data_ Bytes data returned by the call.
function DELEGATECALL(address _target, bytes memory _data)
external
payable
onlyOwner
returns (bool
, bytes memory
)
returns (bool
success_, bytes memory data_
)
{
// slither-disable-next-line controlled-delegatecall
return
_target.delegatecall(_data);
(success_, data_) =
_target.delegatecall(_data);
}
}
packages/contracts-bedrock/package.json
View file @
3d377974
...
...
@@ -29,6 +29,7 @@
"slither"
:
"./scripts/slither.sh"
,
"slither:triage"
:
"TRIAGE_MODE=1 ./scripts/slither.sh"
,
"clean"
:
"rm -rf ./dist ./artifacts ./forge-artifacts ./cache ./tsconfig.tsbuildinfo ./tsconfig.build.tsbuildinfo ./src/contract-artifacts.ts ./test-case-generator/fuzz"
,
"preinstall"
:
"npx only-allow pnpm"
,
"lint:ts:check"
:
"eslint . --max-warnings=0"
,
"lint:forge-tests:check"
:
"ts-node scripts/forge-test-names.ts"
,
"lint:contracts:check"
:
"pnpm solhint -f table 'contracts/**/!(DisputeTypes|RLPReader|EAS|SchemaRegistry|IEAS|ISchemaRegistry|SchemaResolver|EIP712Verifier|ISchemaResolver).sol' && pnpm prettier --check 'contracts/**/!(DisputeTypes|RLPReader|EAS|SchemaRegistry|IEAS|ISchemaRegistry|SchemaResolver|EIP712Verifier|ISchemaResolver).sol' && pnpm lint:forge-tests:check"
,
...
...
packages/contracts-ts/package.json
View file @
3d377974
...
...
@@ -36,6 +36,8 @@
],
"scripts"
:
{
"build"
:
"tsup"
,
"clean"
:
"rm -rf ./dist"
,
"preinstall"
:
"npx only-allow pnpm"
,
"generate"
:
"wagmi generate && pnpm build && pnpm lint:fix"
,
"generate:check"
:
"pnpm generate && git diff --exit-code ./addresses.json && git diff --exit-code ./abis.json"
,
"lint"
:
"prettier --check ."
,
...
...
packages/core-utils/package.json
View file @
3d377974
...
...
@@ -11,6 +11,7 @@
"all"
:
"pnpm clean && pnpm build && pnpm test && pnpm lint:fix && pnpm lint"
,
"build"
:
"tsc -p tsconfig.json"
,
"clean"
:
"rimraf dist/ ./tsconfig.tsbuildinfo"
,
"preinstall"
:
"npx only-allow pnpm"
,
"lint"
:
"pnpm lint:fix && pnpm lint:check"
,
"lint:check"
:
"eslint . --max-warnings=0"
,
"lint:fix"
:
"pnpm lint:check --fix"
,
...
...
packages/replica-healthcheck/package.json
View file @
3d377974
...
...
@@ -13,6 +13,7 @@
"test:coverage"
:
"echo 'No tests defined.'"
,
"build"
:
"tsc -p tsconfig.json"
,
"clean"
:
"rimraf ./dist ./tsconfig.tsbuildinfo"
,
"preinstall"
:
"npx only-allow pnpm"
,
"lint"
:
"pnpm run lint:fix && pnpm run lint:check"
,
"pre-commit"
:
"lint-staged"
,
"lint:fix"
:
"pnpm lint:check --fix"
,
...
...
packages/sdk/package.json
View file @
3d377974
...
...
@@ -12,6 +12,7 @@
"all"
:
"pnpm clean && pnpm build && pnpm test && pnpm lint:fix && pnpm lint"
,
"build"
:
"tsc -p tsconfig.json"
,
"clean"
:
"rimraf dist/ ./tsconfig.tsbuildinfo"
,
"preinstall"
:
"npx only-allow pnpm"
,
"lint"
:
"pnpm lint:fix && pnpm lint:check"
,
"lint:check"
:
"eslint . --max-warnings=0"
,
"lint:fix"
:
"pnpm lint:check --fix"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment