ETH Price: $4,749.86 (+2.37%)

Contract

0x7785a22Facd31dB653bA4928f1D5B81D093f0b2f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Method Block
From
To
0x60a06040226979862025-06-13 20:20:23115 days ago1749846023  Contract Creation0 ETH
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BasicSmartAccount

Compiler Version
v0.8.30+commit.73712a01

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, GNU LGPLv3 license
/**
 *Submitted for verification at Etherscan.io on 2025-06-13
*/

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.30;

/**
 * @title BasicSmartAccount - This contract support batch execution of transactions.
 * The only storage is a nonce to prevent replay attacks.
 * The contract is intended to be used with EIP-7702 where EOA delegates to this contract.
 */
contract BasicSmartAccount {
    struct Storage {
        uint256 nonce;
    }

    // Reserve a unique storage slot for the nonce.
    // * keccak256("BasicSmartAccount") & (~0xff)
    bytes32 private constant _STORAGE =
        0xbdfee0231e0903cde9ca6fd75d08a500062dc3d87718f712bc6958ed69761700;

    // Domain typehash for EIP712 message.
    // * keccak256("EIP712Domain(uint256 chainId,address verifyingContract)");
    bytes32 private constant _DOMAIN_TYPEHASH =
        0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;

    // The struct typehash for the EIP712 message.
    // * keccak256("HandleOps(bytes32 data,uint256 nonce)")
    bytes32 private constant _HANDLEOPS_TYPEHASH =
        0x4f8bb4631e6552ac29b9d6bacf60ff8b5481e2af7c2104fe0261045fa6988111;

    address private immutable ENTRY_POINT;

    error InvalidSignature();

    /**
     * @dev Sends multiple transactions with signature validation and reverts all if one fails.
     * @param userOps Encoded User Ops.
     * @param r The r part of the signature.
     * @param vs The v and s part of the signature.
     */
    function handleOps(
        bytes memory userOps,
        uint256 r,
        uint256 vs
    ) public payable {
        Storage storage $ = _storage();
        uint256 nonce = $.nonce;

        // Calculate the hash of transactions data and nonce for signature verification
        bytes32 domainSeparator = keccak256(
            abi.encode(_DOMAIN_TYPEHASH, block.chainid, address(this))
        );

        bytes32 structHash = keccak256(
            abi.encode(_HANDLEOPS_TYPEHASH, keccak256(userOps), nonce)
        );
        bytes32 digest = keccak256(
            abi.encodePacked("\x19\x01", domainSeparator, structHash)
        );

        // Verify the signature of EIP712 message
        require(_isValidSignature(digest, r, vs), InvalidSignature());

        // Update nonce for the sender to prevent replay attacks
        unchecked {
            $.nonce = nonce + 1;
        }

        /* solhint-disable no-inline-assembly */
        assembly ("memory-safe") {
            let length := mload(userOps)
            let i := 0x20
            for {

            } lt(i, length) {

            } {
                let to := shr(0x60, mload(add(userOps, i)))
                let value := mload(add(userOps, add(i, 0x14)))
                let dataLength := mload(add(userOps, add(i, 0x34)))
                let data := add(userOps, add(i, 0x54))
                let success := call(gas(), to, value, data, dataLength, 0, 0)

                if eq(success, 0) {
                    returndatacopy(0, 0, returndatasize())
                    revert(0, returndatasize())
                }
                i := add(i, add(0x54, dataLength))
            }
        }
        /* solhint-enable no-inline-assembly */
    }

    /**
     * @dev Validates the signature by extracting `v` and `s` from `vs` and using `ecrecover`.
     * @param hash The hash of the signed data.
     * @param r The r part of the signature.
     * @param vs The v and s part of the signature combined.
     * @return bool True if the signature is valid, false otherwise.
     */
    function _isValidSignature(
        bytes32 hash,
        uint256 r,
        uint256 vs
    ) internal view returns (bool) {
        unchecked {
            uint256 v = (vs >> 255) + 27;
            uint256 s = vs &
                0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

            return
                address(this) ==
                ecrecover(hash, uint8(v), bytes32(r), bytes32(s));
        }
    }

    function _storage() private pure returns (Storage storage $) {
        assembly ("memory-safe") {
            $.slot := _STORAGE
        }
    }

    function getNonce() external view returns (uint256) {
        return _storage().nonce;
    }

    // Allow the contract to receive ETH
    fallback() external payable {}

    receive() external payable {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"name":"InvalidSignature","type":"error"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"getNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"userOps","type":"bytes"},{"internalType":"uint256","name":"r","type":"uint256"},{"internalType":"uint256","name":"vs","type":"uint256"}],"name":"handleOps","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052348015600e575f5ffd5b506080516107096100245f395f50506107095ff3fe60806040526004361061002c575f3560e01c806374fa41211461002f578063d087d2881461004b5761002d565b5b005b61004960048036038101906100449190610476565b610075565b005b348015610056575f5ffd5b5061005f610203565b60405161006c91906104f1565b60405180910390f35b5f61007e610214565b90505f815f015490505f7f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a794692185f1b46306040516020016100bf93929190610561565b6040516020818303038152906040528051906020012090505f7f4f8bb4631e6552ac29b9d6bacf60ff8b5481e2af7c2104fe0261045fa69881115f1b87805190602001208460405160200161011693929190610596565b6040516020818303038152906040528051906020012090505f828260405160200161014292919061063f565b60405160208183030381529060405280519060200120905061016581888861023b565b61019b576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018401855f0181905550875160205b818110156101f757808a015160601c601482018b0151603483018c0151605484018d015f5f838386885af15f81036101e5573d5f5f3e3d5ffd5b826054018601955050505050506101ab565b50505050505050505050565b5f61020c610214565b5f0154905090565b5f7fbdfee0231e0903cde9ca6fd75d08a500062dc3d87718f712bc6958ed69761700905090565b5f5f601b60ff84901c0190505f7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8416905060018683875f1b845f1b6040515f81526020016040526040516102939493929190610690565b6020604051602081039080840390855afa1580156102b3573d5f5f3e3d5ffd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614925050509392505050565b5f604051905090565b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6103558261030f565b810181811067ffffffffffffffff821117156103745761037361031f565b5b80604052505050565b5f6103866102f6565b9050610392828261034c565b919050565b5f67ffffffffffffffff8211156103b1576103b061031f565b5b6103ba8261030f565b9050602081019050919050565b828183375f83830152505050565b5f6103e76103e284610397565b61037d565b9050828152602081018484840111156104035761040261030b565b5b61040e8482856103c7565b509392505050565b5f82601f83011261042a57610429610307565b5b813561043a8482602086016103d5565b91505092915050565b5f819050919050565b61045581610443565b811461045f575f5ffd5b50565b5f813590506104708161044c565b92915050565b5f5f5f6060848603121561048d5761048c6102ff565b5b5f84013567ffffffffffffffff8111156104aa576104a9610303565b5b6104b686828701610416565b93505060206104c786828701610462565b92505060406104d886828701610462565b9150509250925092565b6104eb81610443565b82525050565b5f6020820190506105045f8301846104e2565b92915050565b5f819050919050565b61051c8161050a565b82525050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61054b82610522565b9050919050565b61055b81610541565b82525050565b5f6060820190506105745f830186610513565b61058160208301856104e2565b61058e6040830184610552565b949350505050565b5f6060820190506105a95f830186610513565b6105b66020830185610513565b6105c360408301846104e2565b949350505050565b5f81905092915050565b7f19010000000000000000000000000000000000000000000000000000000000005f82015250565b5f6106096002836105cb565b9150610614826105d5565b600282019050919050565b5f819050919050565b6106396106348261050a565b61061f565b82525050565b5f610649826105fd565b91506106558285610628565b6020820191506106658284610628565b6020820191508190509392505050565b5f60ff82169050919050565b61068a81610675565b82525050565b5f6080820190506106a35f830187610513565b6106b06020830186610681565b6106bd6040830185610513565b6106ca6060830184610513565b9594505050505056fea2646970667358221220b70f92f0f444247e14c584dce8172670a9b337ddbf6ac1956db6b265a544ae9164736f6c634300081e0033

Deployed Bytecode

0x60806040526004361061002c575f3560e01c806374fa41211461002f578063d087d2881461004b5761002d565b5b005b61004960048036038101906100449190610476565b610075565b005b348015610056575f5ffd5b5061005f610203565b60405161006c91906104f1565b60405180910390f35b5f61007e610214565b90505f815f015490505f7f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a794692185f1b46306040516020016100bf93929190610561565b6040516020818303038152906040528051906020012090505f7f4f8bb4631e6552ac29b9d6bacf60ff8b5481e2af7c2104fe0261045fa69881115f1b87805190602001208460405160200161011693929190610596565b6040516020818303038152906040528051906020012090505f828260405160200161014292919061063f565b60405160208183030381529060405280519060200120905061016581888861023b565b61019b576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018401855f0181905550875160205b818110156101f757808a015160601c601482018b0151603483018c0151605484018d015f5f838386885af15f81036101e5573d5f5f3e3d5ffd5b826054018601955050505050506101ab565b50505050505050505050565b5f61020c610214565b5f0154905090565b5f7fbdfee0231e0903cde9ca6fd75d08a500062dc3d87718f712bc6958ed69761700905090565b5f5f601b60ff84901c0190505f7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8416905060018683875f1b845f1b6040515f81526020016040526040516102939493929190610690565b6020604051602081039080840390855afa1580156102b3573d5f5f3e3d5ffd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614925050509392505050565b5f604051905090565b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6103558261030f565b810181811067ffffffffffffffff821117156103745761037361031f565b5b80604052505050565b5f6103866102f6565b9050610392828261034c565b919050565b5f67ffffffffffffffff8211156103b1576103b061031f565b5b6103ba8261030f565b9050602081019050919050565b828183375f83830152505050565b5f6103e76103e284610397565b61037d565b9050828152602081018484840111156104035761040261030b565b5b61040e8482856103c7565b509392505050565b5f82601f83011261042a57610429610307565b5b813561043a8482602086016103d5565b91505092915050565b5f819050919050565b61045581610443565b811461045f575f5ffd5b50565b5f813590506104708161044c565b92915050565b5f5f5f6060848603121561048d5761048c6102ff565b5b5f84013567ffffffffffffffff8111156104aa576104a9610303565b5b6104b686828701610416565b93505060206104c786828701610462565b92505060406104d886828701610462565b9150509250925092565b6104eb81610443565b82525050565b5f6020820190506105045f8301846104e2565b92915050565b5f819050919050565b61051c8161050a565b82525050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61054b82610522565b9050919050565b61055b81610541565b82525050565b5f6060820190506105745f830186610513565b61058160208301856104e2565b61058e6040830184610552565b949350505050565b5f6060820190506105a95f830186610513565b6105b66020830185610513565b6105c360408301846104e2565b949350505050565b5f81905092915050565b7f19010000000000000000000000000000000000000000000000000000000000005f82015250565b5f6106096002836105cb565b9150610614826105d5565b600282019050919050565b5f819050919050565b6106396106348261050a565b61061f565b82525050565b5f610649826105fd565b91506106558285610628565b6020820191506106658284610628565b6020820191508190509392505050565b5f60ff82169050919050565b61068a81610675565b82525050565b5f6080820190506106a35f830187610513565b6106b06020830186610681565b6106bd6040830185610513565b6106ca6060830184610513565b9594505050505056fea2646970667358221220b70f92f0f444247e14c584dce8172670a9b337ddbf6ac1956db6b265a544ae9164736f6c634300081e0033

Deployed Bytecode Sourcemap

318:4093:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;1461:1774;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;4197:94;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;1461:1774;1585:17;1605:10;:8;:10::i;:::-;1585:30;;1626:13;1642:1;:7;;;1626:23;;1751;808:66;1812:16;;1830:13;1853:4;1801:58;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;1777:93;;;;;;1751:119;;1883:18;1052:66;1939:19;;1970:7;1960:18;;;;;;1980:5;1928:58;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;1904:93;;;;;;1883:114;;2008:14;2078:15;2095:10;2049:57;;;;;;;;;:::i;:::-;;;;;;;;;;;;;2025:92;;;;;;2008:109;;2189:32;2207:6;2215:1;2218:2;2189:17;:32::i;:::-;2181:61;;;;;;;;;;;;;;;;;2364:1;2356:5;:9;2346:1;:7;;:19;;;;2499:7;2493:14;2530:4;2548:620;2577:6;2574:1;2571:13;2548:620;;;2662:1;2653:7;2649:15;2643:22;2637:4;2633:33;2723:4;2720:1;2716:12;2707:7;2703:26;2697:33;2792:4;2789:1;2785:12;2776:7;2772:26;2766:33;2849:4;2846:1;2842:12;2833:7;2829:26;2932:1;2929;2917:10;2911:4;2904:5;2900:2;2893:5;2888:46;2969:1;2960:7;2957:14;2954:147;;3016:16;3013:1;3010;2995:38;3065:16;3062:1;3055:27;2954:147;3141:10;3135:4;3131:21;3128:1;3124:29;3119:34;;2604:564;;;;;2548:620;;;2464:715;;;;;;;1461:1774;;;:::o;4197:94::-;4240:7;4267:10;:8;:10::i;:::-;:16;;;4260:23;;4197:94;:::o;4041:148::-;4083:17;4163:8;4153:18;;4041:148;:::o;3584:449::-;3705:4;3747:9;3773:2;3766:3;3760:2;:9;;3759:16;3747:28;;3790:9;3824:66;3802:2;:88;3790:100;;3965:49;3975:4;3987:1;3999;3991:10;;4011:1;4003:10;;3965:49;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3931:83;;3939:4;3931:83;;;3907:107;;;;3584:449;;;;;:::o;7:75:1:-;40:6;73:2;67:9;57:19;;7:75;:::o;88:117::-;197:1;194;187:12;211:117;320:1;317;310:12;334:117;443:1;440;433:12;457:117;566:1;563;556:12;580:102;621:6;672:2;668:7;663:2;656:5;652:14;648:28;638:38;;580:102;;;:::o;688:180::-;736:77;733:1;726:88;833:4;830:1;823:15;857:4;854:1;847:15;874:281;957:27;979:4;957:27;:::i;:::-;949:6;945:40;1087:6;1075:10;1072:22;1051:18;1039:10;1036:34;1033:62;1030:88;;;1098:18;;:::i;:::-;1030:88;1138:10;1134:2;1127:22;917:238;874:281;;:::o;1161:129::-;1195:6;1222:20;;:::i;:::-;1212:30;;1251:33;1279:4;1271:6;1251:33;:::i;:::-;1161:129;;;:::o;1296:307::-;1357:4;1447:18;1439:6;1436:30;1433:56;;;1469:18;;:::i;:::-;1433:56;1507:29;1529:6;1507:29;:::i;:::-;1499:37;;1591:4;1585;1581:15;1573:23;;1296:307;;;:::o;1609:148::-;1707:6;1702:3;1697;1684:30;1748:1;1739:6;1734:3;1730:16;1723:27;1609:148;;;:::o;1763:423::-;1840:5;1865:65;1881:48;1922:6;1881:48;:::i;:::-;1865:65;:::i;:::-;1856:74;;1953:6;1946:5;1939:21;1991:4;1984:5;1980:16;2029:3;2020:6;2015:3;2011:16;2008:25;2005:112;;;2036:79;;:::i;:::-;2005:112;2126:54;2173:6;2168:3;2163;2126:54;:::i;:::-;1846:340;1763:423;;;;;:::o;2205:338::-;2260:5;2309:3;2302:4;2294:6;2290:17;2286:27;2276:122;;2317:79;;:::i;:::-;2276:122;2434:6;2421:20;2459:78;2533:3;2525:6;2518:4;2510:6;2506:17;2459:78;:::i;:::-;2450:87;;2266:277;2205:338;;;;:::o;2549:77::-;2586:7;2615:5;2604:16;;2549:77;;;:::o;2632:122::-;2705:24;2723:5;2705:24;:::i;:::-;2698:5;2695:35;2685:63;;2744:1;2741;2734:12;2685:63;2632:122;:::o;2760:139::-;2806:5;2844:6;2831:20;2822:29;;2860:33;2887:5;2860:33;:::i;:::-;2760:139;;;;:::o;2905:797::-;2991:6;2999;3007;3056:2;3044:9;3035:7;3031:23;3027:32;3024:119;;;3062:79;;:::i;:::-;3024:119;3210:1;3199:9;3195:17;3182:31;3240:18;3232:6;3229:30;3226:117;;;3262:79;;:::i;:::-;3226:117;3367:62;3421:7;3412:6;3401:9;3397:22;3367:62;:::i;:::-;3357:72;;3153:286;3478:2;3504:53;3549:7;3540:6;3529:9;3525:22;3504:53;:::i;:::-;3494:63;;3449:118;3606:2;3632:53;3677:7;3668:6;3657:9;3653:22;3632:53;:::i;:::-;3622:63;;3577:118;2905:797;;;;;:::o;3708:118::-;3795:24;3813:5;3795:24;:::i;:::-;3790:3;3783:37;3708:118;;:::o;3832:222::-;3925:4;3963:2;3952:9;3948:18;3940:26;;3976:71;4044:1;4033:9;4029:17;4020:6;3976:71;:::i;:::-;3832:222;;;;:::o;4060:77::-;4097:7;4126:5;4115:16;;4060:77;;;:::o;4143:118::-;4230:24;4248:5;4230:24;:::i;:::-;4225:3;4218:37;4143:118;;:::o;4267:126::-;4304:7;4344:42;4337:5;4333:54;4322:65;;4267:126;;;:::o;4399:96::-;4436:7;4465:24;4483:5;4465:24;:::i;:::-;4454:35;;4399:96;;;:::o;4501:118::-;4588:24;4606:5;4588:24;:::i;:::-;4583:3;4576:37;4501:118;;:::o;4625:442::-;4774:4;4812:2;4801:9;4797:18;4789:26;;4825:71;4893:1;4882:9;4878:17;4869:6;4825:71;:::i;:::-;4906:72;4974:2;4963:9;4959:18;4950:6;4906:72;:::i;:::-;4988;5056:2;5045:9;5041:18;5032:6;4988:72;:::i;:::-;4625:442;;;;;;:::o;5073:::-;5222:4;5260:2;5249:9;5245:18;5237:26;;5273:71;5341:1;5330:9;5326:17;5317:6;5273:71;:::i;:::-;5354:72;5422:2;5411:9;5407:18;5398:6;5354:72;:::i;:::-;5436;5504:2;5493:9;5489:18;5480:6;5436:72;:::i;:::-;5073:442;;;;;;:::o;5521:148::-;5623:11;5660:3;5645:18;;5521:148;;;;:::o;5675:214::-;5815:66;5811:1;5803:6;5799:14;5792:90;5675:214;:::o;5895:400::-;6055:3;6076:84;6158:1;6153:3;6076:84;:::i;:::-;6069:91;;6169:93;6258:3;6169:93;:::i;:::-;6287:1;6282:3;6278:11;6271:18;;5895:400;;;:::o;6301:79::-;6340:7;6369:5;6358:16;;6301:79;;;:::o;6386:157::-;6491:45;6511:24;6529:5;6511:24;:::i;:::-;6491:45;:::i;:::-;6486:3;6479:58;6386:157;;:::o;6549:663::-;6790:3;6812:148;6956:3;6812:148;:::i;:::-;6805:155;;6970:75;7041:3;7032:6;6970:75;:::i;:::-;7070:2;7065:3;7061:12;7054:19;;7083:75;7154:3;7145:6;7083:75;:::i;:::-;7183:2;7178:3;7174:12;7167:19;;7203:3;7196:10;;6549:663;;;;;:::o;7218:86::-;7253:7;7293:4;7286:5;7282:16;7271:27;;7218:86;;;:::o;7310:112::-;7393:22;7409:5;7393:22;:::i;:::-;7388:3;7381:35;7310:112;;:::o;7428:545::-;7601:4;7639:3;7628:9;7624:19;7616:27;;7653:71;7721:1;7710:9;7706:17;7697:6;7653:71;:::i;:::-;7734:68;7798:2;7787:9;7783:18;7774:6;7734:68;:::i;:::-;7812:72;7880:2;7869:9;7865:18;7856:6;7812:72;:::i;:::-;7894;7962:2;7951:9;7947:18;7938:6;7894:72;:::i;:::-;7428:545;;;;;;;:::o

Swarm Source

ipfs://b70f92f0f444247e14c584dce8172670a9b337ddbf6ac1956db6b265a544ae91

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.