Address Contract Partially Verified
Address
0x1d64231E179f074BAA3f22d44a6Ca3a2670b2709
Balance
0 ETH
Nonce
1
Code Size
10500 bytes
Creator
0x4B5F0ba2...6052 at tx 0xb704d71d...e11c53
Indexed Transactions
0
Contract Bytecode
10500 bytes
0x608060405234801561000f575f80fd5b5060043610610135575f3560e01c80638129fc1c116100b657806395d89b411161007a57806395d89b41146103295780639afcd33614610347578063a9059cbb14610377578063cc9338a3146103a7578063dd62ed3e146103c5578063f64bdbc0146103f557610135565b80638129fc1c1461029557806383ba6b591461029f5780638ad9403f146102cf5780638dae9318146102ed5780638fc590141461030b57610135565b806323b872dd116100fd57806323b872dd146101df5780632f81bc711461020f578063313ce5671461022b57806340c10f191461024957806370a082311461026557610135565b806306fdde0314610139578063095ea7b314610157578063178bc9d51461018757806318160ddd146101a55780631e89d545146101c3575b5f80fd5b610141610413565b60405161014e91906119fb565b60405180910390f35b610171600480360381019061016c9190611ab9565b6104b1565b60405161017e9190611b11565b60405180910390f35b61018f6104d3565b60405161019c9190611b39565b60405180910390f35b6101ad6104eb565b6040516101ba9190611b61565b60405180910390f35b6101dd60048036038101906101d89190611d7a565b610502565b005b6101f960048036038101906101f49190611df0565b610742565b6040516102069190611b11565b60405180910390f35b61022960048036038101906102249190611d7a565b610770565b005b6102336108db565b6040516102409190611e5b565b60405180910390f35b610263600480360381019061025e9190611ab9565b6108e3565b005b61027f600480360381019061027a9190611e74565b610bc3565b60405161028c9190611b61565b60405180910390f35b61029d610c16565b005b6102b960048036038101906102b49190611e74565b611031565b6040516102c69190611b61565b60405180910390f35b6102d7611089565b6040516102e49190611b61565b60405180910390f35b6102f5611091565b6040516103029190611b61565b60405180910390f35b610313611099565b6040516103209190611b39565b60405180910390f35b6103316110b1565b60405161033e91906119fb565b60405180910390f35b610361600480360381019061035c9190611e74565b61114f565b60405161036e9190611b61565b60405180910390f35b610391600480360381019061038c9190611ab9565b611195565b60405161039e9190611b11565b60405180910390f35b6103af6111b7565b6040516103bc9190611b39565b60405180910390f35b6103df60048036038101906103da9190611e9f565b6111cf565b6040516103ec9190611b61565b60405180910390f35b6103fd61125f565b60405161040a9190611b61565b60405180910390f35b60605f61041e611267565b905080600301805461042f90611f0a565b80601f016020809104026020016040519081016040528092919081815260200182805461045b90611f0a565b80156104a65780601f1061047d576101008083540402835291602001916104a6565b820191905f5260205f20905b81548152906001019060200180831161048957829003601f168201915b505050505091505090565b5f806104bb61128e565b90506104c8818585611295565b600191505092915050565b73c3b48a2a0995499dca3a77001b53337b289e85eb81565b5f806104f5611267565b9050806002015491505090565b5f825111610545576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053c90611f84565b60405180910390fd5b8051825114610589576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058090612012565b60405180910390fd5b5f805b8351811015610626575f8382815181106105a9576105a8612030565b5b6020026020010151116105f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e8906120a7565b60405180910390fd5b82818151811061060457610603612030565b5b60200260200101518261061791906120f2565b9150808060010191505061058c565b5061063033610bc3565b811115610672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066990612195565b60405180910390fd5b5f5b835181101561073c573073ffffffffffffffffffffffffffffffffffffffff166323b872dd338684815181106106ad576106ac612030565b5b60200260200101518685815181106106c8576106c7612030565b5b60200260200101516040518463ffffffff1660e01b81526004016106ee939291906121b3565b6020604051808303815f875af115801561070a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061072e9190612212565b508080600101915050610674565b50505050565b5f8061074c61128e565b90506107598582856112a7565b610764858585611339565b60019150509392505050565b60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff166107f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f0906122ad565b60405180910390fd5b5f82511161083c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083390612315565b60405180910390fd5b8051825114610880576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108779061237d565b60405180910390fd5b5f5b82518110156108d6576108c98382815181106108a1576108a0612030565b5b60200260200101518383815181106108bc576108bb612030565b5b60200260200101516108e3565b8080600101915050610882565b505050565b5f6012905090565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610951576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610948906123e5565b60405180910390fd5b60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff166109da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109d1906122ad565b60405180910390fd5b5f8111610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a139061244d565b60405180910390fd5b670de0b6b3a76400006314dc9380610a34919061246b565b81610a3d6104eb565b610a4791906120f2565b1115610a88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7f9061251c565b60405180910390fd5b670de0b6b3a76400005f803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054610ad8919061246b565b8160015f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054610b2191906120f2565b1115610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906125aa565b60405180910390fd5b8060015f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254610bae91906120f2565b92505081905550610bbf8282611429565b5050565b5f80610bcd611267565b9050805f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054915050919050565b5f610c1f6114a8565b90505f815f0160089054906101000a900460ff161590505f825f015f9054906101000a900467ffffffffffffffff1690505f808267ffffffffffffffff16148015610c675750825b90505f60018367ffffffffffffffff16148015610c9a57505f3073ffffffffffffffffffffffffffffffffffffffff163b145b905081158015610ca8575080155b15610cdf576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001855f015f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508315610d2c576001855f0160086101000a81548160ff0219169083151502179055505b610da06040518060400160405280600481526020017f46696173000000000000000000000000000000000000000000000000000000008152506040518060400160405280600481526020017f46494153000000000000000000000000000000000000000000000000000000008152506114cf565b600160025f7380489c4d8dedefb102cfd2421083373d8027763b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600160025f73c3b48a2a0995499dca3a77001b53337b289e85eb73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550630a6e49c05f807380489c4d8dedefb102cfd2421083373d8027763b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550630a6e49c05f8073c3b48a2a0995499dca3a77001b53337b289e85eb73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055505f60015f7380489c4d8dedefb102cfd2421083373d8027763b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055505f60015f73c3b48a2a0995499dca3a77001b53337b289e85eb73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550831561102a575f855f0160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d26001604051611021919061261d565b60405180910390a15b5050505050565b5f670de0b6b3a76400005f808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054611082919061246b565b9050919050565b630a6e49c081565b6314dc938081565b734b5f0ba242ab6ef0de44bffdee2646f80e89605281565b60605f6110bc611267565b90508060040180546110cd90611f0a565b80601f01602080910402602001604051908101604052809291908181526020018280546110f990611f0a565b80156111445780601f1061111b57610100808354040283529160200191611144565b820191905f5260205f20905b81548152906001019060200180831161112757829003601f168201915b505050505091505090565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b5f8061119f61128e565b90506111ac818585611339565b600191505092915050565b7380489c4d8dedefb102cfd2421083373d8027763b81565b5f806111d9611267565b9050806001015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205491505092915050565b630a6e49c081565b5f7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00905090565b5f33905090565b6112a283838360016114e5565b505050565b5f6112b284846111cf565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146113335781811015611324578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161131b93929190612636565b60405180910390fd5b61133284848484035f6114e5565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036113a9575f6040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016113a09190611b39565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611419575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016114109190611b39565b60405180910390fd5b6114248383836116c2565b505050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611499575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016114909190611b39565b60405180910390fd5b6114a45f83836116c2565b5050565b5f7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b6114d76118f1565b6114e18282611931565b5050565b5f6114ee611267565b90505f73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603611560575f6040517fe602df050000000000000000000000000000000000000000000000000000000081526004016115579190611b39565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036115d0575f6040517f94280d620000000000000000000000000000000000000000000000000000000081526004016115c79190611b39565b60405180910390fd5b82816001015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208190555081156116bb578373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516116b29190611b61565b60405180910390a35b5050505050565b5f6116cb611267565b90505f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361171f5781816002015f82825461171391906120f2565b925050819055506117f1565b5f815f015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050828110156117aa578481846040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016117a193929190612636565b60405180910390fd5b828103825f015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361183a5781816002015f8282540392505081905550611886565b81815f015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118e39190611b61565b60405180910390a350505050565b6118f961196d565b61192f576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6119396118f1565b5f611942611267565b90508281600301908161195591906127ff565b508181600401908161196791906127ff565b50505050565b5f6119766114a8565b5f0160089054906101000a900460ff16905090565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6119cd8261198b565b6119d78185611995565b93506119e78185602086016119a5565b6119f0816119b3565b840191505092915050565b5f6020820190508181035f830152611a1381846119c3565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611a5582611a2c565b9050919050565b611a6581611a4b565b8114611a6f575f80fd5b50565b5f81359050611a8081611a5c565b92915050565b5f819050919050565b611a9881611a86565b8114611aa2575f80fd5b50565b5f81359050611ab381611a8f565b92915050565b5f8060408385031215611acf57611ace611a24565b5b5f611adc85828601611a72565b9250506020611aed85828601611aa5565b9150509250929050565b5f8115159050919050565b611b0b81611af7565b82525050565b5f602082019050611b245f830184611b02565b92915050565b611b3381611a4b565b82525050565b5f602082019050611b4c5f830184611b2a565b92915050565b611b5b81611a86565b82525050565b5f602082019050611b745f830184611b52565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611bb4826119b3565b810181811067ffffffffffffffff82111715611bd357611bd2611b7e565b5b80604052505050565b5f611be5611a1b565b9050611bf18282611bab565b919050565b5f67ffffffffffffffff821115611c1057611c0f611b7e565b5b602082029050602081019050919050565b5f80fd5b5f611c37611c3284611bf6565b611bdc565b90508083825260208201905060208402830185811115611c5a57611c59611c21565b5b835b81811015611c835780611c6f8882611a72565b845260208401935050602081019050611c5c565b5050509392505050565b5f82601f830112611ca157611ca0611b7a565b5b8135611cb1848260208601611c25565b91505092915050565b5f67ffffffffffffffff821115611cd457611cd3611b7e565b5b602082029050602081019050919050565b5f611cf7611cf284611cba565b611bdc565b90508083825260208201905060208402830185811115611d1a57611d19611c21565b5b835b81811015611d435780611d2f8882611aa5565b845260208401935050602081019050611d1c565b5050509392505050565b5f82601f830112611d6157611d60611b7a565b5b8135611d71848260208601611ce5565b91505092915050565b5f8060408385031215611d9057611d8f611a24565b5b5f83013567ffffffffffffffff811115611dad57611dac611a28565b5b611db985828601611c8d565b925050602083013567ffffffffffffffff811115611dda57611dd9611a28565b5b611de685828601611d4d565b9150509250929050565b5f805f60608486031215611e0757611e06611a24565b5b5f611e1486828701611a72565b9350506020611e2586828701611a72565b9250506040611e3686828701611aa5565b9150509250925092565b5f60ff82169050919050565b611e5581611e40565b82525050565b5f602082019050611e6e5f830184611e4c565b92915050565b5f60208284031215611e8957611e88611a24565b5b5f611e9684828501611a72565b91505092915050565b5f8060408385031215611eb557611eb4611a24565b5b5f611ec285828601611a72565b9250506020611ed385828601611a72565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680611f2157607f821691505b602082108103611f3457611f33611edd565b5b50919050565b7f4e6f20726563697069656e7473206c69737465642e00000000000000000000005f82015250565b5f611f6e601583611995565b9150611f7982611f3a565b602082019050919050565b5f6020820190508181035f830152611f9b81611f62565b9050919050565b7f416d6f756e7420616e6420726563697069656e74206c656e6774687320646f205f8201527f6e6f74206d617463682e00000000000000000000000000000000000000000000602082015250565b5f611ffc602a83611995565b915061200782611fa2565b604082019050919050565b5f6020820190508181035f83015261202981611ff0565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f457665727920616d6f756e74206d75737420626520706f7369746976652e00005f82015250565b5f612091601e83611995565b915061209c8261205d565b602082019050919050565b5f6020820190508181035f8301526120be81612085565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6120fc82611a86565b915061210783611a86565b925082820190508082111561211f5761211e6120c5565b5b92915050565b7f53656e64657220646f6573206e6f74206861766520656e6f75676820466961735f8201527f20746f6b656e732e000000000000000000000000000000000000000000000000602082015250565b5f61217f602883611995565b915061218a82612125565b604082019050919050565b5f6020820190508181035f8301526121ac81612173565b9050919050565b5f6060820190506121c65f830186611b2a565b6121d36020830185611b2a565b6121e06040830184611b52565b949350505050565b6121f181611af7565b81146121fb575f80fd5b50565b5f8151905061220c816121e8565b92915050565b5f6020828403121561222757612226611a24565b5b5f612234848285016121fe565b91505092915050565b7f43616c6c657220646f6573206e6f74206861766520746865206d696e746572205f8201527f726f6c6500000000000000000000000000000000000000000000000000000000602082015250565b5f612297602483611995565b91506122a28261223d565b604082019050919050565b5f6020820190508181035f8301526122c48161228b565b9050919050565b7f4e6f206d696e7420726563697069656e74732e000000000000000000000000005f82015250565b5f6122ff601383611995565b915061230a826122cb565b602082019050919050565b5f6020820190508181035f83015261232c816122f3565b9050919050565b7f526563697069656e742f416d6f756e74206d69736d617463682e0000000000005f82015250565b5f612367601a83611995565b915061237282612333565b602082019050919050565b5f6020820190508181035f8301526123948161235b565b9050919050565b7f4d696e7420746f20746865207a65726f206164647265737300000000000000005f82015250565b5f6123cf601883611995565b91506123da8261239b565b602082019050919050565b5f6020820190508181035f8301526123fc816123c3565b9050919050565b7f496e76616c696420616d6f756e7420287a65726f206f72206c657373292e00005f82015250565b5f612437601e83611995565b915061244282612403565b602082019050919050565b5f6020820190508181035f8301526124648161242b565b9050919050565b5f61247582611a86565b915061248083611a86565b925082820261248e81611a86565b915082820484148315176124a5576124a46120c5565b5b5092915050565b7f4d696e74696e67207468697320616d6f756e7420776f756c64206578636565645f8201527f2074686520676c6f62616c206c696d6974000000000000000000000000000000602082015250565b5f612506603183611995565b9150612511826124ac565b604082019050919050565b5f6020820190508181035f830152612533816124fa565b9050919050565b7f4d696e7420616d6f756e742065786365656473207468652063616c6c657227735f8201527f206d696e74696e67206c696d6974000000000000000000000000000000000000602082015250565b5f612594602e83611995565b915061259f8261253a565b604082019050919050565b5f6020820190508181035f8301526125c181612588565b9050919050565b5f819050919050565b5f67ffffffffffffffff82169050919050565b5f819050919050565b5f6126076126026125fd846125c8565b6125e4565b6125d1565b9050919050565b612617816125ed565b82525050565b5f6020820190506126305f83018461260e565b92915050565b5f6060820190506126495f830186611b2a565b6126566020830185611b52565b6126636040830184611b52565b949350505050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026126c77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261268c565b6126d1868361268c565b95508019841693508086168417925050509392505050565b5f6127036126fe6126f984611a86565b6125e4565b611a86565b9050919050565b5f819050919050565b61271c836126e9565b6127306127288261270a565b848454612698565b825550505050565b5f90565b612744612738565b61274f818484612713565b505050565b5b81811015612772576127675f8261273c565b600181019050612755565b5050565b601f8211156127b7576127888161266b565b6127918461267d565b810160208510156127a0578190505b6127b46127ac8561267d565b830182612754565b50505b505050565b5f82821c905092915050565b5f6127d75f19846008026127bc565b1980831691505092915050565b5f6127ef83836127c8565b9150826002028217905092915050565b6128088261198b565b67ffffffffffffffff81111561282157612820611b7e565b5b61282b8254611f0a565b612836828285612776565b5f60209050601f831160018114612867575f8415612855578287015190505b61285f85826127e4565b8655506128c6565b601f1984166128758661266b565b5f5b8281101561289c57848901518255600182019150602085019450602081019050612877565b868310156128b957848901516128b5601f8916826127c8565b8355505b6001600288020188555050505b50505050505056fea2646970667358221220454c0c512cd208b21d3dddd112fcfade8a63ca78f014ecdbbea37db9a8c658fe64736f6c63430008190033
Verified Source Code Partial Match
Compiler: v0.8.25+commit.b61c2a91
EVM: cancun
Optimization: No
Fias.sol 956 lines
// File: @openzeppelin/contracts/interfaces/draft-IERC6093.sol
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
// File: @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}
// File: @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File: @openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*/
abstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {
/// @custom:storage-location erc7201:openzeppelin.storage.ERC20
struct ERC20Storage {
mapping(address account => uint256) _balances;
mapping(address account => mapping(address spender => uint256)) _allowances;
uint256 _totalSupply;
string _name;
string _symbol;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC20")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;
function _getERC20Storage() private pure returns (ERC20Storage storage $) {
assembly {
$.slot := ERC20StorageLocation
}
}
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
ERC20Storage storage $ = _getERC20Storage();
$._name = name_;
$._symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
ERC20Storage storage $ = _getERC20Storage();
return $._name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
ERC20Storage storage $ = _getERC20Storage();
return $._symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
ERC20Storage storage $ = _getERC20Storage();
return $._totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual returns (uint256) {
ERC20Storage storage $ = _getERC20Storage();
return $._balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual returns (uint256) {
ERC20Storage storage $ = _getERC20Storage();
return $._allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
ERC20Storage storage $ = _getERC20Storage();
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
$._totalSupply += value;
} else {
uint256 fromBalance = $._balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
$._balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
$._totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
$._balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
* ```
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
ERC20Storage storage $ = _getERC20Storage();
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
$._allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
// File: contracts/Fias.sol
pragma solidity 0.8.25;
contract Fias is ERC20Upgradeable {
mapping(address => uint256) internal _minterLimit;
mapping(address => uint256) internal _mintedAmount;
mapping(address => bool) internal _explicitMinter;
//Limit constants are integers (multplied by 10^18 in the mint() function)
uint256 public constant GLOBAL_LIMIT = 350000000;
address public constant FOREVVER_MINTER = 0xC3b48A2a0995499DCa3A77001B53337b289E85EB;
uint256 public constant FOREVVER_LIMIT = 175000000;
address public constant LITCRAFT_MINTER = 0x80489c4d8dEdEfB102CFD2421083373d8027763b;
uint256 public constant LITCRAFT_LIMIT = 175000000;
address public constant CONTRACT_ADMIN = 0x4B5F0ba242AB6ef0De44bFFdEe2646f80E896052;
function initialize() public initializer {
__ERC20_init("Fias", "FIAS");
_explicitMinter[LITCRAFT_MINTER] = true;
_explicitMinter[FOREVVER_MINTER] = true;
_minterLimit[LITCRAFT_MINTER] = LITCRAFT_LIMIT;
_minterLimit[FOREVVER_MINTER] = FOREVVER_LIMIT;
_mintedAmount[LITCRAFT_MINTER] = 0;
_mintedAmount[FOREVVER_MINTER] = 0;
}
function multiTransfer(address[] memory recipients, uint256[] memory amounts) public {
require(recipients.length > 0, "No recipients listed.");
require(recipients.length == amounts.length, "Amount and recipient lengths do not match.");
uint256 totalAmount = 0;
for (uint256 i = 0; i < recipients.length; i++) {
require(amounts[i] > 0, "Every amount must be positive.");
totalAmount += amounts[i];
}
require(totalAmount <= balanceOf(msg.sender), "Sender does not have enough Fias tokens.");
for (uint256 i = 0; i < recipients.length; i++) {
this.transferFrom(msg.sender, recipients[i], amounts[i]);
}
}
function multiMint(address[] memory recipients, uint256[] memory amounts) public {
require(_explicitMinter[msg.sender], "Caller does not have the minter role");
require(recipients.length > 0, "No mint recipients.");
require(recipients.length == amounts.length, "Recipient/Amount mismatch.");
for (uint256 i = 0; i < recipients.length; i++) {
mint(recipients[i], amounts[i]);
}
}
function mint(address to, uint256 amount) public {
require(to != address(0), "Mint to the zero address");
require(_explicitMinter[msg.sender], "Caller does not have the minter role");
require(amount > 0, "Invalid amount (zero or less).");
require(totalSupply() + amount <= GLOBAL_LIMIT*(10**18), "Minting this amount would exceed the global limit");
require(_mintedAmount[msg.sender] + amount <= _minterLimit[msg.sender]*(10**18), "Mint amount exceeds the caller's minting limit");
_mintedAmount[msg.sender] += amount;
_mint(to, amount);
}
function getMinterLimit(address minter) external view returns (uint256) {
return _minterLimit[minter]*(10**18);
}
function getMintedAmountBy(address minter) external view returns (uint256) {
return _mintedAmount[minter];
}
}
Read Contract
CONTRACT_ADMIN 0x8fc59014 → address
FOREVVER_LIMIT 0xf64bdbc0 → uint256
FOREVVER_MINTER 0x178bc9d5 → address
GLOBAL_LIMIT 0x8dae9318 → uint256
LITCRAFT_LIMIT 0x8ad9403f → uint256
LITCRAFT_MINTER 0xcc9338a3 → address
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
getMintedAmountBy 0x9afcd336 → uint256
getMinterLimit 0x83ba6b59 → uint256
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 7 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 value
returns: bool
initialize 0x8129fc1c
No parameters
mint 0x40c10f19
address to
uint256 amount
multiMint 0x2f81bc71
address[] recipients
uint256[] amounts
multiTransfer 0x1e89d545
address[] recipients
uint256[] amounts
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
Recent Transactions
No transactions found for this address