UNPKG

@settlemint/solidity-soulbound

Version:

Smart contract set to build an Soulbound token in SettleMint

402 lines 12.3 kB
{ "compiler": { "version": "0.8.27+commit.40a35a09" }, "language": "Solidity", "output": { "abi": [ { "inputs": [ { "internalType": "address", "name": "account", "type": "address", "indexed": true }, { "internalType": "address", "name": "operator", "type": "address", "indexed": true }, { "internalType": "bool", "name": "approved", "type": "bool", "indexed": false } ], "type": "event", "name": "ApprovalForAll", "anonymous": false }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address", "indexed": true }, { "internalType": "address", "name": "from", "type": "address", "indexed": true }, { "internalType": "address", "name": "to", "type": "address", "indexed": true }, { "internalType": "uint256[]", "name": "ids", "type": "uint256[]", "indexed": false }, { "internalType": "uint256[]", "name": "values", "type": "uint256[]", "indexed": false } ], "type": "event", "name": "TransferBatch", "anonymous": false }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address", "indexed": true }, { "internalType": "address", "name": "from", "type": "address", "indexed": true }, { "internalType": "address", "name": "to", "type": "address", "indexed": true }, { "internalType": "uint256", "name": "id", "type": "uint256", "indexed": false }, { "internalType": "uint256", "name": "value", "type": "uint256", "indexed": false } ], "type": "event", "name": "TransferSingle", "anonymous": false }, { "inputs": [ { "internalType": "string", "name": "value", "type": "string", "indexed": false }, { "internalType": "uint256", "name": "id", "type": "uint256", "indexed": true } ], "type": "event", "name": "URI", "anonymous": false }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "id", "type": "uint256" } ], "stateMutability": "view", "type": "function", "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ] }, { "inputs": [ { "internalType": "address[]", "name": "accounts", "type": "address[]" }, { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" } ], "stateMutability": "view", "type": "function", "name": "balanceOfBatch", "outputs": [ { "internalType": "uint256[]", "name": "", "type": "uint256[]" } ] }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "stateMutability": "view", "type": "function", "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ] }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "values", "type": "uint256[]" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "stateMutability": "nonpayable", "type": "function", "name": "safeBatchTransferFrom" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "stateMutability": "nonpayable", "type": "function", "name": "safeTransferFrom" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function", "name": "setApprovalForAll" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "stateMutability": "view", "type": "function", "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ] }, { "inputs": [ { "internalType": "uint256", "name": "id", "type": "uint256" } ], "stateMutability": "view", "type": "function", "name": "uri", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ] } ], "devdoc": { "kind": "dev", "methods": { "balanceOf(address,uint256)": { "details": "Returns the value of tokens of token type `id` owned by `account`." }, "balanceOfBatch(address[],uint256[])": { "details": "xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. Requirements: - `accounts` and `ids` must have the same length." }, "isApprovedForAll(address,address)": { "details": "Returns true if `operator` is approved to transfer ``account``'s tokens. See {setApprovalForAll}." }, "safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)": { "details": "xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. WARNING: This function can potentially allow a reentrancy attack when transferring tokens to an untrusted contract, when invoking {IERC1155Receiver-onERC1155BatchReceived} on the receiver. Ensure to follow the checks-effects-interactions pattern and consider employing reentrancy guards when interacting with untrusted contracts. Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments. Requirements: - `ids` and `values` must have the same length. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value." }, "safeTransferFrom(address,address,uint256,uint256,bytes)": { "details": "Transfers a `value` amount of tokens of type `id` from `from` to `to`. WARNING: This function can potentially allow a reentrancy attack when transferring tokens to an untrusted contract, when invoking {IERC1155Receiver-onERC1155Received} on the receiver. Ensure to follow the checks-effects-interactions pattern and consider employing reentrancy guards when interacting with untrusted contracts. Emits a {TransferSingle} event. Requirements: - `to` cannot be the zero address. - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. - `from` must have a balance of tokens of type `id` of at least `value` amount. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value." }, "setApprovalForAll(address,bool)": { "details": "Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, Emits an {ApprovalForAll} event. Requirements: - `operator` cannot be the zero address." }, "supportsInterface(bytes4)": { "details": "Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] to learn more about how these ids are created. This function call must use less than 30 000 gas." }, "uri(uint256)": { "details": "Returns the URI for token type `id`. If the `\\{id\\}` substring is present in the URI, it must be replaced by clients with the actual token type ID." } }, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }, "settings": { "remappings": [ "@openzeppelin/=node_modules/@openzeppelin/", "erc721a/=node_modules/erc721a/", "forge-std/=lib/forge-std/src/", "hardhat/=node_modules/hardhat/" ], "optimizer": { "enabled": true, "runs": 10000 }, "metadata": { "bytecodeHash": "ipfs" }, "compilationTarget": { "node_modules/@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": "IERC1155MetadataURI" }, "evmVersion": "cancun", "libraries": {}, "viaIR": true }, "sources": { "node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { "keccak256": "0xf189f9b417fe1931e1ab706838aff1128528694a9fcdb5ff7665197f2ca57d09", "urls": [ "bzz-raw://2ff0143c836c8c9f85d13708733c09e21251395847fccfb518bf3b556726a840", "dweb:/ipfs/QmP69sjjrQrhYAsvCSSB69Bx66SiUPdQUqdzMYnf4wANHm" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { "keccak256": "0x98c32de9b02f43eba7c0aba9fadf331cffb35a8d2076dce1d556c8f2cad704aa", "urls": [ "bzz-raw://38f68f76e741cce3ca4e0f8ece5ab9d69a203829311a403bafc8f7b95a7e6d63", "dweb:/ipfs/QmZ8PrDXU5DiZ7fzEoRN7vHMQdemtsqvYVV5AdvAnScS4o" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol": { "keccak256": "0x8891738ffe910f0cf2da09566928589bf5d63f4524dd734fd9cedbac3274dd5c", "urls": [ "bzz-raw://971f954442df5c2ef5b5ebf1eb245d7105d9fbacc7386ee5c796df1d45b21617", "dweb:/ipfs/QmadRjHbkicwqwwh61raUEapaVEtaLMcYbQZWs9gUkgj3u" ], "license": "MIT" } }, "version": 1 }