[ { "inputs": [ { "internalType": "address", "name": "_creditScoreContract", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [ { "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ERC1155InsufficientBalance", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "approver", "type": "address" } ], "name": "ERC1155InvalidApprover", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "idsLength", "type": "uint256" }, { "internalType": "uint256", "name": "valuesLength", "type": "uint256" } ], "name": "ERC1155InvalidArrayLength", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" } ], "name": "ERC1155InvalidOperator", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "receiver", "type": "address" } ], "name": "ERC1155InvalidReceiver", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "sender", "type": "address" } ], "name": "ERC1155InvalidSender", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" } ], "name": "ERC1155MissingApprovalForAll", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "tier", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "score", "type": "uint256" } ], "name": "CreditNFTMinted", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }, { "indexed": false, "internalType": "uint256[]", "name": "values", "type": "uint256[]" } ], "name": "TransferBatch", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "id", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "TransferSingle", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "value", "type": "string" }, { "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" } ], "name": "URI", "type": "event" }, { "inputs": [], "name": "BRONZE", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "BRONZE_THRESHOLD", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "GOLD", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "GOLD_THRESHOLD", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "SILVER", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "SILVER_THRESHOLD", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "id", "type": "uint256" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address[]", "name": "accounts", "type": "address[]" }, { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" } ], "name": "balanceOfBatch", "outputs": [ { "internalType": "uint256[]", "name": "", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tier", "type": "uint256" } ], "name": "burnNFT", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } ], "name": "checkEligibility", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "creditScoreContract", "outputs": [ { "internalType": "contract CreditScore", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "score", "type": "uint256" } ], "name": "getEligibleTier", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "hasMinted", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } ], "name": "hasUserMinted", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "mintCreditNFT", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "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" } ], "name": "safeBatchTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "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" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "uri", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" } ]
608060405234801561001057600080fd5b50604051611a0b380380611a0b83398101604081905261002f91610087565b6040518060800160405280604d81526020016119be604d913961005181610077565b50600380546001600160a01b0319166001600160a01b0392909216919091179055610214565b60026100838282610156565b5050565b60006020828403121561009957600080fd5b81516001600160a01b03811681146100b057600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806100e157607f821691505b60208210810361010157634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561015157806000526020600020601f840160051c8101602085101561012e5750805b601f840160051c820191505b8181101561014e576000815560010161013a565b50505b505050565b81516001600160401b0381111561016f5761016f6100b7565b6101838161017d84546100cd565b84610107565b6020601f8211600181146101b7576000831561019f5750848201515b600019600385901b1c1916600184901b17845561014e565b600084815260208120601f198516915b828110156101e757878501518255602094850194600190920191016101c7565b50848210156102055786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b61179b806102236000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80634fc281f2116100b8578063c1a0db301161007c578063c1a0db30146102b7578063e00fd543146102bf578063e3e55f08146102c7578063e7bf2f1b146102cf578063e985e9c5146102d7578063f242432a146102ea57600080fd5b80634fc281f214610255578063569739741461028157806369a2f026146102895780637723bafb14610291578063a22cb465146102a457600080fd5b80632890e0d7116100ff5780632890e0d7146101e25780632eb2c2d6146101f757806338e21cce1461020a5780633e4bee381461022d5780634e1273f41461023557600080fd5b8062fdd58e1461013b57806301ffc9a71461016157806303a42b6f146101845780630e89341c146101af5780631cd10e27146101cf575b600080fd5b61014e6101493660046110cb565b6102fd565b6040519081526020015b60405180910390f35b61017461016f36600461110e565b610325565b6040519015158152602001610158565b600354610197906001600160a01b031681565b6040516001600160a01b039091168152602001610158565b6101c26101bd36600461112b565b610375565b6040516101589190611194565b61014e6101dd36600461112b565b6103a6565b6101f56101f036600461112b565b61042a565b005b6101f56102053660046112ef565b61049a565b6101746102183660046113a5565b60046020526000908152604090205460ff1681565b61014e600281565b6102486102433660046113c0565b610501565b60405161015891906114c5565b6101746102633660046113a5565b6001600160a01b031660009081526004602052604090205460ff1690565b61014e605081565b61014e601e81565b61014e61029f3660046113a5565b6105ce565b6101f56102b23660046114d8565b610652565b61014e603c81565b61014e600081565b61014e600181565b6101f5610661565b6101746102e5366004611514565b6107f8565b6101f56102f8366004611547565b610826565b6000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061035657506001600160e01b031982166303a24d0760e21b145b8061031f57506301ffc9a760e01b6001600160e01b031983161461031f565b606061038082610885565b60405160200161039091906115a0565b6040516020818303038152906040529050919050565b6000605082106103b857506002919050565b603c82106103c857506001919050565b601e82106103d857506000919050565b60405162461bcd60e51b815260206004820152601a60248201527f53636f726520746f6f206c6f7720666f7220616e79207469657200000000000060448201526064015b60405180910390fd5b919050565b600061043633836102fd565b116104745760405162461bcd60e51b815260206004820152600e60248201526d27379027232a103a3790313ab93760911b604482015260640161041c565b61048033826001610918565b50336000908152600460205260409020805460ff19169055565b336001600160a01b03861681148015906104bb57506104b986826107f8565b155b156104ec5760405163711bec9160e11b81526001600160a01b0380831660048301528716602482015260440161041c565b6104f98686868686610987565b505050505050565b606081518351146105325781518351604051635b05999160e01b81526004810192909252602482015260440161041c565b6000835167ffffffffffffffff81111561054e5761054e6111a7565b604051908082528060200260200182016040528015610577578160200160208202803683370190505b50905060005b84518110156105c6576020808202860101516105a1906020808402870101516102fd565b8282815181106105b3576105b3611627565b602090810291909101015260010161057d565b509392505050565b6003546040516380bb727360e01b81526001600160a01b03838116600483015260009283929116906380bb727390602401602060405180830381865afa15801561061c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610640919061163d565b905061064b816103a6565b9392505050565b61065d3383836109e7565b5050565b3360009081526004602052604090205460ff16156106b65760405162461bcd60e51b8152602060048201526012602482015271105b1c9958591e481b5a5b9d19590813919560721b604482015260640161041c565b6003546040516380bb727360e01b81523360048201526000916001600160a01b0316906380bb727390602401602060405180830381865afa1580156106ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610723919061163d565b9050601e81101561076e5760405162461bcd60e51b815260206004820152601560248201527414d8dbdc99481d1bdbc81b1bddc81d1bc81b5a5b9d605a1b604482015260640161041c565b6000610779826103a6565b90506107973382600160405180602001604052806000815250610a7d565b3360008181526004602052604090819020805460ff19166001179055517fda65bc9fe15a52266f673aaf7c760afd4bce133bb81aa00953284e7337fdeeb8906107ec9084908690918252602082015260400190565b60405180910390a25050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b336001600160a01b0386168114801590610847575061084586826107f8565b155b156108785760405163711bec9160e11b81526001600160a01b0380831660048301528716602482015260440161041c565b6104f98686868686610ada565b6060600061089283610b68565b600101905060008167ffffffffffffffff8111156108b2576108b26111a7565b6040519080825280601f01601f1916602001820160405280156108dc576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846108e657509392505050565b6001600160a01b03831661094157604051626a0d4560e21b81526000600482015260240161041c565b604080516001808252602082018590528183019081526060820184905260a0820190925260006080820181815291929161098091879185908590610c40565b5050505050565b6001600160a01b0384166109b157604051632bfa23e760e11b81526000600482015260240161041c565b6001600160a01b0385166109da57604051626a0d4560e21b81526000600482015260240161041c565b6109808585858585610c40565b6001600160a01b038216610a105760405162ced3e160e81b81526000600482015260240161041c565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038416610aa757604051632bfa23e760e11b81526000600482015260240161041c565b604080516001808252602082018690528183019081526060820185905260808201909252906104f9600087848487610c40565b6001600160a01b038416610b0457604051632bfa23e760e11b81526000600482015260240161041c565b6001600160a01b038516610b2d57604051626a0d4560e21b81526000600482015260240161041c565b60408051600180825260208201869052818301908152606082018590526080820190925290610b5f8787848487610c40565b50505050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610ba75772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310610bd3576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610bf157662386f26fc10000830492506010015b6305f5e1008310610c09576305f5e100830492506008015b6127108310610c1d57612710830492506004015b60648310610c2f576064830492506002015b600a831061031f5760010192915050565b610c4c85858585610c93565b6001600160a01b038416156109805782513390600103610c855760208481015190840151610c7e838989858589610ea7565b50506104f9565b6104f9818787878787610fcb565b8051825114610cc25781518151604051635b05999160e01b81526004810192909252602482015260440161041c565b3360005b8351811015610dc8576020818102858101820151908501909101516001600160a01b03881615610d79576000828152602081815260408083206001600160a01b038c16845290915290205481811015610d52576040516303dee4c560e01b81526001600160a01b038a16600482015260248101829052604481018390526064810184905260840161041c565b6000838152602081815260408083206001600160a01b038d16845290915290209082900390555b6001600160a01b03871615610dbe576000828152602081815260408083206001600160a01b038b16845290915281208054839290610db8908490611656565b90915550505b5050600101610cc6565b508251600103610e495760208301516000906020840151909150856001600160a01b0316876001600160a01b0316846001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051610e3a929190918252602082015260400190565b60405180910390a45050610980565b836001600160a01b0316856001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051610e98929190611677565b60405180910390a45050505050565b6001600160a01b0384163b156104f95760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190610eeb90899089908890889088906004016116a5565b6020604051808303816000875af1925050508015610f26575060408051601f3d908101601f19168201909252610f23918101906116ea565b60015b610f8f573d808015610f54576040519150601f19603f3d011682016040523d82523d6000602084013e610f59565b606091505b508051600003610f8757604051632bfa23e760e11b81526001600160a01b038616600482015260240161041c565b805181602001fd5b6001600160e01b0319811663f23a6e6160e01b14610b5f57604051632bfa23e760e11b81526001600160a01b038616600482015260240161041c565b6001600160a01b0384163b156104f95760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061100f9089908990889088908890600401611707565b6020604051808303816000875af192505050801561104a575060408051601f3d908101601f19168201909252611047918101906116ea565b60015b611078573d808015610f54576040519150601f19603f3d011682016040523d82523d6000602084013e610f59565b6001600160e01b0319811663bc197c8160e01b14610b5f57604051632bfa23e760e11b81526001600160a01b038616600482015260240161041c565b80356001600160a01b038116811461042557600080fd5b600080604083850312156110de57600080fd5b6110e7836110b4565b946020939093013593505050565b6001600160e01b03198116811461110b57600080fd5b50565b60006020828403121561112057600080fd5b813561064b816110f5565b60006020828403121561113d57600080fd5b5035919050565b60005b8381101561115f578181015183820152602001611147565b50506000910152565b60008151808452611180816020860160208601611144565b601f01601f19169290920160200192915050565b60208152600061064b6020830184611168565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156111e6576111e66111a7565b604052919050565b600067ffffffffffffffff821115611208576112086111a7565b5060051b60200190565b600082601f83011261122357600080fd5b8135611236611231826111ee565b6111bd565b8082825260208201915060208360051b86010192508583111561125857600080fd5b602085015b8381101561127557803583526020928301920161125d565b5095945050505050565b600082601f83011261129057600080fd5b813567ffffffffffffffff8111156112aa576112aa6111a7565b6112bd601f8201601f19166020016111bd565b8181528460208386010111156112d257600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561130757600080fd5b611310866110b4565b945061131e602087016110b4565b9350604086013567ffffffffffffffff81111561133a57600080fd5b61134688828901611212565b935050606086013567ffffffffffffffff81111561136357600080fd5b61136f88828901611212565b925050608086013567ffffffffffffffff81111561138c57600080fd5b6113988882890161127f565b9150509295509295909350565b6000602082840312156113b757600080fd5b61064b826110b4565b600080604083850312156113d357600080fd5b823567ffffffffffffffff8111156113ea57600080fd5b8301601f810185136113fb57600080fd5b8035611409611231826111ee565b8082825260208201915060208360051b85010192508783111561142b57600080fd5b6020840193505b8284101561145457611443846110b4565b825260209384019390910190611432565b9450505050602083013567ffffffffffffffff81111561147357600080fd5b61147f85828601611212565b9150509250929050565b600081518084526020840193506020830160005b828110156114bb57815186526020958601959091019060010161149d565b5093949350505050565b60208152600061064b6020830184611489565b600080604083850312156114eb57600080fd5b6114f4836110b4565b91506020830135801515811461150957600080fd5b809150509250929050565b6000806040838503121561152757600080fd5b611530836110b4565b915061153e602084016110b4565b90509250929050565b600080600080600060a0868803121561155f57600080fd5b611568866110b4565b9450611576602087016110b4565b93506040860135925060608601359150608086013567ffffffffffffffff81111561138c57600080fd5b7f68747470733a2f2f697066732e696f2f697066732f516d556853414b7457394381527f4a454c676443425350346179444c7663334e4c6f7052516979455446386578796020820152637976712f60e01b60408201526000825161160b816044850160208701611144565b64173539b7b760d91b6044939091019283015250604901919050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561164f57600080fd5b5051919050565b8082018082111561031f57634e487b7160e01b600052601160045260246000fd5b60408152600061168a6040830185611489565b828103602084015261169c8185611489565b95945050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906116df90830184611168565b979650505050505050565b6000602082840312156116fc57600080fd5b815161064b816110f5565b6001600160a01b0386811682528516602082015260a06040820181905260009061173390830186611489565b82810360608401526117458186611489565b905082810360808401526117598185611168565b9897505050505050505056fea264697066735822122054853e288cc0b449a882d57d01352fe1789576601e38bb418cc440fdb6c5552e64736f6c634300081a003368747470733a2f2f697066732e696f2f697066732f516d556853414b745739434a454c676443425350346179444c7663334e4c6f7052516979455446386578797976712f7b69647d2e6a736f6e00000000000000000000000000b28fb286fe2bb0163799c192ccb5477d924ca0