diff --git a/contracts/account/draft-Account.sol b/contracts/account/Account.sol similarity index 86% rename from contracts/account/draft-Account.sol rename to contracts/account/Account.sol index b849032f..bc6aeda3 100644 --- a/contracts/account/draft-Account.sol +++ b/contracts/account/Account.sol @@ -4,8 +4,8 @@ pragma solidity ^0.8.20; import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; -import {ERC7739Signer} from "../utils/cryptography/draft-ERC7739Signer.sol"; -import {AccountCore} from "./draft-AccountCore.sol"; +import {ERC7739Signer} from "../utils/cryptography/ERC7739Signer.sol"; +import {AccountCore} from "./AccountCore.sol"; /** * @dev Extension of {AccountCore} with recommended feature that most account abstraction implementation will want: diff --git a/contracts/account/draft-AccountCore.sol b/contracts/account/AccountCore.sol similarity index 100% rename from contracts/account/draft-AccountCore.sol rename to contracts/account/AccountCore.sol diff --git a/contracts/account/extensions/draft-AccountSignerERC7702.sol b/contracts/account/extensions/AccountSignerERC7702.sol similarity index 92% rename from contracts/account/extensions/draft-AccountSignerERC7702.sol rename to contracts/account/extensions/AccountSignerERC7702.sol index 879939cd..845e909f 100644 --- a/contracts/account/extensions/draft-AccountSignerERC7702.sol +++ b/contracts/account/extensions/AccountSignerERC7702.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.20; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {AccountCore} from "../draft-AccountCore.sol"; +import {AccountCore} from "../AccountCore.sol"; /** * @dev {Account} implementation whose low-level signature validation is done by an EOA. diff --git a/contracts/crosschain/axelar/AxelarGatewayDestination.sol b/contracts/crosschain/axelar/AxelarGatewayDestination.sol index e88276e6..96bd841b 100644 --- a/contracts/crosschain/axelar/AxelarGatewayDestination.sol +++ b/contracts/crosschain/axelar/AxelarGatewayDestination.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.27; import {AxelarExecutable} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/executable/AxelarExecutable.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; -import {IERC7786Receiver} from "../../interfaces/draft-IERC7786.sol"; +import {IERC7786Receiver} from "../../interfaces/IERC7786.sol"; import {AxelarGatewayBase} from "./AxelarGatewayBase.sol"; /** diff --git a/contracts/crosschain/axelar/AxelarGatewaySource.sol b/contracts/crosschain/axelar/AxelarGatewaySource.sol index be43b64b..1290e8e5 100644 --- a/contracts/crosschain/axelar/AxelarGatewaySource.sol +++ b/contracts/crosschain/axelar/AxelarGatewaySource.sol @@ -6,7 +6,7 @@ import {CAIP2} from "@openzeppelin/contracts/utils/CAIP2.sol"; import {CAIP10} from "@openzeppelin/contracts/utils/CAIP10.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {AxelarGatewayBase} from "./AxelarGatewayBase.sol"; -import {IERC7786GatewaySource} from "../../interfaces/draft-IERC7786.sol"; +import {IERC7786GatewaySource} from "../../interfaces/IERC7786.sol"; /** * @dev Implementation of an ERC-7786 gateway source adapter for the Axelar Network. diff --git a/contracts/crosschain/utils/draft-ERC7786Receiver.sol b/contracts/crosschain/utils/ERC7786Receiver.sol similarity index 96% rename from contracts/crosschain/utils/draft-ERC7786Receiver.sol rename to contracts/crosschain/utils/ERC7786Receiver.sol index 5a5136af..a889bf02 100644 --- a/contracts/crosschain/utils/draft-ERC7786Receiver.sol +++ b/contracts/crosschain/utils/ERC7786Receiver.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.27; -import {IERC7786Receiver} from "../../interfaces/draft-IERC7786.sol"; +import {IERC7786Receiver} from "../../interfaces/IERC7786.sol"; /** * @dev Base implementation of an ERC-7786 compliant cross-chain message receiver. diff --git a/contracts/interfaces/draft-IERC7786.sol b/contracts/interfaces/IERC7786.sol similarity index 100% rename from contracts/interfaces/draft-IERC7786.sol rename to contracts/interfaces/IERC7786.sol diff --git a/contracts/interfaces/draft-IERC7802.sol b/contracts/interfaces/IERC7802.sol similarity index 100% rename from contracts/interfaces/draft-IERC7802.sol rename to contracts/interfaces/IERC7802.sol diff --git a/contracts/mocks/account/AccountBaseMock.sol b/contracts/mocks/account/AccountBaseMock.sol index dd03e69a..104678c4 100644 --- a/contracts/mocks/account/AccountBaseMock.sol +++ b/contracts/mocks/account/AccountBaseMock.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.20; import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol"; import {ERC4337Utils} from "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol"; -import {Account} from "../../account/draft-Account.sol"; +import {Account} from "../../account/Account.sol"; abstract contract AccountBaseMock is Account { /// Validates a user operation with a boolean signature. diff --git a/contracts/mocks/account/AccountECDSAMock.sol b/contracts/mocks/account/AccountECDSAMock.sol index 1e478b57..5b3ec70e 100644 --- a/contracts/mocks/account/AccountECDSAMock.sol +++ b/contracts/mocks/account/AccountECDSAMock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; -import {Account} from "../../account/draft-Account.sol"; +import {Account} from "../../account/Account.sol"; import {SignerECDSA} from "../../utils/cryptography/SignerECDSA.sol"; abstract contract AccountECDSAMock is Account, SignerECDSA { diff --git a/contracts/mocks/account/AccountERC7702Mock.sol b/contracts/mocks/account/AccountERC7702Mock.sol index 12779efa..7d646455 100644 --- a/contracts/mocks/account/AccountERC7702Mock.sol +++ b/contracts/mocks/account/AccountERC7702Mock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; -import {Account} from "../../account/draft-Account.sol"; -import {AccountSignerERC7702} from "../../account/extensions/draft-AccountSignerERC7702.sol"; +import {Account} from "../../account/Account.sol"; +import {AccountSignerERC7702} from "../../account/extensions/AccountSignerERC7702.sol"; abstract contract AccountERC7702Mock is Account, AccountSignerERC7702 {} diff --git a/contracts/mocks/account/AccountP256Mock.sol b/contracts/mocks/account/AccountP256Mock.sol index 2bbd20cd..41c71ca0 100644 --- a/contracts/mocks/account/AccountP256Mock.sol +++ b/contracts/mocks/account/AccountP256Mock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; -import {Account} from "../../account/draft-Account.sol"; +import {Account} from "../../account/Account.sol"; import {SignerP256} from "../../utils/cryptography/SignerP256.sol"; abstract contract AccountP256Mock is Account, SignerP256 { diff --git a/contracts/mocks/account/AccountRSAMock.sol b/contracts/mocks/account/AccountRSAMock.sol index 46c1a708..73903553 100644 --- a/contracts/mocks/account/AccountRSAMock.sol +++ b/contracts/mocks/account/AccountRSAMock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; -import {Account} from "../../account/draft-Account.sol"; +import {Account} from "../../account/Account.sol"; import {SignerRSA} from "../../utils/cryptography/SignerRSA.sol"; abstract contract AccountRSAMock is Account, SignerRSA { diff --git a/contracts/mocks/crosschain/ERC7786GatewayMock.sol b/contracts/mocks/crosschain/ERC7786GatewayMock.sol index c4bc477e..a1b09313 100644 --- a/contracts/mocks/crosschain/ERC7786GatewayMock.sol +++ b/contracts/mocks/crosschain/ERC7786GatewayMock.sol @@ -6,7 +6,7 @@ import {BitMaps} from "@openzeppelin/contracts/utils/structs/BitMaps.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {CAIP2} from "@openzeppelin/contracts/utils/CAIP2.sol"; import {CAIP10} from "@openzeppelin/contracts/utils/CAIP10.sol"; -import {IERC7786GatewaySource, IERC7786Receiver} from "../../interfaces/draft-IERC7786.sol"; +import {IERC7786GatewaySource, IERC7786Receiver} from "../../interfaces/IERC7786.sol"; contract ERC7786GatewayMock is IERC7786GatewaySource { using BitMaps for BitMaps.BitMap; diff --git a/contracts/mocks/crosschain/ERC7786ReceiverInvalidMock.sol b/contracts/mocks/crosschain/ERC7786ReceiverInvalidMock.sol index 035e3b4b..742f5e33 100644 --- a/contracts/mocks/crosschain/ERC7786ReceiverInvalidMock.sol +++ b/contracts/mocks/crosschain/ERC7786ReceiverInvalidMock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; -import {IERC7786Receiver} from "../../interfaces/draft-IERC7786.sol"; +import {IERC7786Receiver} from "../../interfaces/IERC7786.sol"; contract ERC7786ReceiverInvalidMock is IERC7786Receiver { function executeMessage( diff --git a/contracts/mocks/crosschain/ERC7786ReceiverMock.sol b/contracts/mocks/crosschain/ERC7786ReceiverMock.sol index 54ec4592..0960ea14 100644 --- a/contracts/mocks/crosschain/ERC7786ReceiverMock.sol +++ b/contracts/mocks/crosschain/ERC7786ReceiverMock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; -import {ERC7786Receiver} from "../../crosschain/utils/draft-ERC7786Receiver.sol"; +import {ERC7786Receiver} from "../../crosschain/utils/ERC7786Receiver.sol"; contract ERC7786ReceiverMock is ERC7786Receiver { address private immutable _gateway; diff --git a/contracts/mocks/docs/account/MyAccountCustom.sol b/contracts/mocks/docs/account/MyAccountCustom.sol new file mode 100644 index 00000000..08cf51e1 --- /dev/null +++ b/contracts/mocks/docs/account/MyAccountCustom.sol @@ -0,0 +1,32 @@ +// contracts/MyAccountCustom.sol +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; +import {ERC4337Utils, PackedUserOperation} from "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol"; +import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; +import {Account} from "../../../account/Account.sol"; + +contract MyAccountCustom is Account, Initializable { + /** + * NOTE: EIP-712 domain is set at construction because each account clone + * will recalculate its domain separator based on their own address. + */ + constructor() EIP712("MyAccountCustom", "1") { + _disableInitializers(); + } + + /// @dev Set up the account (e.g. load public keys to storage). + function initialize() public virtual initializer { + // Custom initialization logic + } + + /// @dev Receives a hash wrapped in an EIP-712 domain separator. + function _rawSignatureValidation( + bytes32 hash, + bytes calldata signature + ) internal view virtual override returns (bool) { + // Custom signing logic + } +} diff --git a/contracts/mocks/token/draft-ERC20BridgeableMock.sol b/contracts/mocks/token/ERC20BridgeableMock.sol similarity index 95% rename from contracts/mocks/token/draft-ERC20BridgeableMock.sol rename to contracts/mocks/token/ERC20BridgeableMock.sol index d3163e03..b7af091e 100644 --- a/contracts/mocks/token/draft-ERC20BridgeableMock.sol +++ b/contracts/mocks/token/ERC20BridgeableMock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; -import {ERC20, ERC20Bridgeable} from "../../token/ERC20/extensions/draft-ERC20Bridgeable.sol"; +import {ERC20, ERC20Bridgeable} from "../../token/ERC20/extensions/ERC20Bridgeable.sol"; abstract contract ERC20BridgeableMock is ERC20Bridgeable { address bridge; diff --git a/contracts/mocks/utils/cryptography/ERC7739SignerECDSAMock.sol b/contracts/mocks/utils/cryptography/ERC7739SignerECDSAMock.sol index b8fbb78d..248a4fe9 100644 --- a/contracts/mocks/utils/cryptography/ERC7739SignerECDSAMock.sol +++ b/contracts/mocks/utils/cryptography/ERC7739SignerECDSAMock.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.20; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; -import {ERC7739Signer} from "../../../utils/cryptography/draft-ERC7739Signer.sol"; +import {ERC7739Signer} from "../../../utils/cryptography/ERC7739Signer.sol"; import {SignerECDSA} from "../../../utils/cryptography/SignerECDSA.sol"; contract ERC7739SignerECDSAMock is ERC7739Signer, SignerECDSA { diff --git a/contracts/mocks/utils/cryptography/ERC7739SignerP256Mock.sol b/contracts/mocks/utils/cryptography/ERC7739SignerP256Mock.sol index 5b473ace..7ab7efe2 100644 --- a/contracts/mocks/utils/cryptography/ERC7739SignerP256Mock.sol +++ b/contracts/mocks/utils/cryptography/ERC7739SignerP256Mock.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.20; import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; -import {ERC7739Signer} from "../../../utils/cryptography/draft-ERC7739Signer.sol"; +import {ERC7739Signer} from "../../../utils/cryptography/ERC7739Signer.sol"; import {SignerP256} from "../../../utils/cryptography/SignerP256.sol"; contract ERC7739SignerP256Mock is ERC7739Signer, SignerP256 { diff --git a/contracts/mocks/utils/cryptography/ERC7739SignerRSAMock.sol b/contracts/mocks/utils/cryptography/ERC7739SignerRSAMock.sol index 3f9a1583..56db1f88 100644 --- a/contracts/mocks/utils/cryptography/ERC7739SignerRSAMock.sol +++ b/contracts/mocks/utils/cryptography/ERC7739SignerRSAMock.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.20; import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; -import {ERC7739Signer} from "../../../utils/cryptography/draft-ERC7739Signer.sol"; +import {ERC7739Signer} from "../../../utils/cryptography/ERC7739Signer.sol"; import {SignerRSA} from "../../../utils/cryptography/SignerRSA.sol"; contract ERC7739SignerRSAMock is ERC7739Signer, SignerRSA { diff --git a/contracts/token/ERC20/extensions/draft-ERC20Bridgeable.sol b/contracts/token/ERC20/extensions/ERC20Bridgeable.sol similarity index 96% rename from contracts/token/ERC20/extensions/draft-ERC20Bridgeable.sol rename to contracts/token/ERC20/extensions/ERC20Bridgeable.sol index 3bbd6970..aec8fbc4 100644 --- a/contracts/token/ERC20/extensions/draft-ERC20Bridgeable.sol +++ b/contracts/token/ERC20/extensions/ERC20Bridgeable.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.20; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {ERC165, IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; -import {IERC7802} from "../../../interfaces/draft-IERC7802.sol"; +import {IERC7802} from "../../../interfaces/IERC7802.sol"; /** * @dev ERC20 extension that implements the standard token interface according to diff --git a/contracts/utils/cryptography/draft-ERC7739Signer.sol b/contracts/utils/cryptography/ERC7739Signer.sol similarity index 98% rename from contracts/utils/cryptography/draft-ERC7739Signer.sol rename to contracts/utils/cryptography/ERC7739Signer.sol index 61e820ca..20cf38f6 100644 --- a/contracts/utils/cryptography/draft-ERC7739Signer.sol +++ b/contracts/utils/cryptography/ERC7739Signer.sol @@ -7,7 +7,7 @@ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import {ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol"; import {AbstractSigner} from "./AbstractSigner.sol"; -import {ERC7739Utils} from "./draft-ERC7739Utils.sol"; +import {ERC7739Utils} from "./ERC7739Utils.sol"; /** * @dev Validates signatures wrapping the message hash in a nested EIP712 type. See {ERC7739Utils}. diff --git a/contracts/utils/cryptography/draft-ERC7739Utils.sol b/contracts/utils/cryptography/ERC7739Utils.sol similarity index 100% rename from contracts/utils/cryptography/draft-ERC7739Utils.sol rename to contracts/utils/cryptography/ERC7739Utils.sol diff --git a/test/account/draft-AccountBase.test.js b/test/account/AccountBase.test.js similarity index 100% rename from test/account/draft-AccountBase.test.js rename to test/account/AccountBase.test.js diff --git a/test/account/draft-AccountECDSA.test.js b/test/account/AccountECDSA.test.js similarity index 100% rename from test/account/draft-AccountECDSA.test.js rename to test/account/AccountECDSA.test.js diff --git a/test/account/draft-AccountP256.test.js b/test/account/AccountP256.test.js similarity index 100% rename from test/account/draft-AccountP256.test.js rename to test/account/AccountP256.test.js diff --git a/test/account/draft-AccountRSA.test.js b/test/account/AccountRSA.test.js similarity index 100% rename from test/account/draft-AccountRSA.test.js rename to test/account/AccountRSA.test.js diff --git a/test/token/ERC20/extensions/draft-ERC20Bridgeable.test.js b/test/token/ERC20/extensions/ERC20Bridgeable.test.js similarity index 100% rename from test/token/ERC20/extensions/draft-ERC20Bridgeable.test.js rename to test/token/ERC20/extensions/ERC20Bridgeable.test.js diff --git a/test/utils/cryptography/draft-ERC7739Signer.test.js b/test/utils/cryptography/ERC7739Signer.test.js similarity index 100% rename from test/utils/cryptography/draft-ERC7739Signer.test.js rename to test/utils/cryptography/ERC7739Signer.test.js diff --git a/test/utils/cryptography/draft-ERC7739Utils.test.js b/test/utils/cryptography/ERC7739Utils.test.js similarity index 100% rename from test/utils/cryptography/draft-ERC7739Utils.test.js rename to test/utils/cryptography/ERC7739Utils.test.js