{
  "contractName": "Diamond",
  "abi": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "owner",
          "type": "address"
        }
      ],
      "stateMutability": "payable",
      "type": "constructor"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "previousOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "OwnershipTransferred",
      "type": "event"
    },
    {
      "stateMutability": "payable",
      "type": "fallback"
    },
    {
      "stateMutability": "payable",
      "type": "receive"
    }
  ],
  "bytecode": "0x60806040526040516200325238038062003252833981016040819052620000269162000cd2565b60006200003d6200056d60201b620000d51760201c565b80546001600160a01b0319166001600160a01b0384169081178255604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36000604051620000979062000c54565b604051809103906000f080158015620000b4573d6000803e3d6000fd5b5090506000604051620000c79062000c62565b604051809103906000f080158015620000e4573d6000803e3d6000fd5b5090506000604051620000f79062000c70565b604051809103906000f08015801562000114573d6000803e3d6000fd5b506040805160038082526080820190925291925060609190816020015b6200013b62000c7e565b8152602001906001900390816200013157905050905083816000815181106200016057fe5b60209081029190910101516001600160a01b03919091169052604080516001808252818301909252908160200160208202803683370190505081600081518110620001a757fe5b60200260200101516020018190525063e712b4e160e01b81600081518110620001cc57fe5b602002602001015160200151600081518110620001e557fe5b60200260200101906001600160e01b03191690816001600160e01b0319168152505082816001815181106200021657fe5b6020908102919091018101516001600160a01b039290921690915260408051600580825260c0820190925291820160a08036833701905050816001815181106200025c57fe5b60200260200101516020018190525063adfca15e60e01b816001815181106200028157fe5b6020026020010151602001516000815181106200029a57fe5b6001600160e01b0319909216602092830291909101909101528051637a0ed62760e01b9082906001908110620002cc57fe5b602002602001015160200151600181518110620002e557fe5b6001600160e01b03199092166020928302919091019091015280516366ffd66360e11b90829060019081106200031757fe5b6020026020010151602001516002815181106200033057fe5b6001600160e01b03199092166020928302919091019091015280516314bbdacb60e21b90829060019081106200036257fe5b6020026020010151602001516003815181106200037b57fe5b6001600160e01b03199092166020928302919091019091015280516301ffc9a760e01b9082906001908110620003ad57fe5b602002602001015160200151600481518110620003c657fe5b60200260200101906001600160e01b03191690816001600160e01b031916815250508181600281518110620003f757fe5b60209081029190910101516001600160a01b03919091169052604080516002808252606082019092529081602001602082028036833701905050816002815181106200043f57fe5b60200260200101516020018190525063f2fde38b60e01b816002815181106200046457fe5b6020026020010151602001516000815181106200047d57fe5b6001600160e01b0319909216602092830291909101909101528051638da5cb5b60e01b9082906002908110620004af57fe5b602002602001015160200151600181518110620004c857fe5b6001600160e01b0319909216602092830291909101820152620004f6908290620000f962000591821b17901c565b50506301ffc9a760e01b6000908152600490930160205250506040808220805460ff19908116600190811790925563e712b4e160e01b845282842080548216831790556348e2b09360e01b845282842080548216831790556307f5828d60e41b845291909220805490911690911790555062000e61565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b6000620005a86200056d60201b620000d51760201c565b905060005b825181101562000802576000838281518110620005c657fe5b60209081029190910101515190506001600160a01b038116156200078b576001600160a01b038116600090815260028401602052604090206001015461ffff16801580156200062d57506001600160a01b0382166000908152600285016020526040902054155b15620006ae5762000658826040518060600160405280602481526020016200322e6024913962000850565b506003830180546001808201835560009283526020808420830180546001600160a01b0319166001600160a01b03871690811790915584526002870190526040909220909101805461ffff191661ffff83161790555b60005b858481518110620006be57fe5b6020026020010151602001515181101562000783576000868581518110620006e257fe5b6020026020010151602001518281518110620006fa57fe5b6020908102919091018101516001600160e01b031981166000908152600189019092526040909120549091506001600160a01b031680620007475762000741858362000883565b62000778565b846001600160a01b0316816001600160a01b03161462000778576200076c8262000938565b62000778858362000883565b5050600101620006b1565b5050620007f8565b60005b8483815181106200079b57fe5b60200260200101516020015151811015620007f657620007ed858481518110620007c157fe5b6020026020010151602001518281518110620007d957fe5b60200260200101516200093860201b60201c565b6001016200078e565b505b50600101620005ad565b5060408051600080825260208201928390527f39725dd03d877043d78fdfe186295e46e6277eb0a3498f2adb51071f42a2bdcb92620008449286929162000da3565b60405180910390a15050565b813b81816200087d5760405162461bcd60e51b815260040162000874919062000e4c565b60405180910390fd5b50505050565b60006200089a6200056d60201b620000d51760201c565b6001600160a01b03909316600081815260028501602090815260408083208054600180820183559185528385206008820401805460e08a901c600460078516026101000a90810263ffffffff909102199091161790556001600160e01b03199097168452909601905293909320805461ffff909316600160a01b0261ffff60a01b196001600160a01b03199094169094179290921692909217905550565b60006200094f6200056d60201b620000d51760201c565b6001600160e01b0319831660009081526001820160205260409020549091506001600160a01b0316806200098557505062000c51565b6001600160e01b0319831660009081526001830160209081526040808320546001600160a01b03851684526002860190925282208054600160a01b90920461ffff169260001983019290919083908110620009dc57fe5b90600052602060002090600891828204019190066004029054906101000a900460e01b9050856001600160e01b031916816001600160e01b0319161462000aaf576001600160a01b0384166000908152600286016020526040902080548291908590811062000a4757fe5b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b0319831681526001870190915260409020805461ffff60a01b1916600160a01b61ffff8616021790555b6001600160a01b0384166000908152600286016020526040902080548062000ad357fe5b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319881682526001870190526040902080546001600160b01b03191690558162000c4b576003850180546000198101916000918390811062000b4957fe5b60009182526020808320909101546001600160a01b0389811680855260028c019093526040909320600101549216925061ffff90911690821462000be3578188600301828154811062000b9857fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055918416815260028a0190915260409020600101805461ffff191661ffff83161790555b8760030180548062000bf157fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028a019052604081209062000c3a828262000c96565b50600101805461ffff191690555050505b50505050505b50565b610f5c806200191683390190565b61073f806200287283390190565b61027d8062002fb183390190565b60408051808201909152600081526060602082015290565b50805460008255600701600890049060005260206000209081019062000c5191905b8082111562000cce576000815560010162000cb8565b5090565b60006020828403121562000ce4578081fd5b81516001600160a01b038116811462000cfb578182fd5b9392505050565b6001600160a01b03169052565b6000815180845260208085019450808401835b8381101562000d4a5781516001600160e01b0319168752958201959082019060010162000d22565b509495945050505050565b60008151808452815b8181101562000d7c5760208185018101518683018201520162000d5e565b8181111562000d8e5782602083870101525b50601f01601f19169290920160200192915050565b60006060820160608352808651808352608085019150602092506080838202860101838901855b8381101562000e1b57607f198884030185528151604062000ded85835162000d02565b878201519150808886015262000e068186018362000d0f565b96880196945050509085019060010162000dca565b505062000e2b8487018962000d02565b858103604087015262000e3f818862000d55565b9998505050505050505050565b60006020825262000cfb602083018462000d55565b610aa58062000e716000396000f3fe60806040523661000b57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d60205260409020547fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9081906001600160a01b0316806100b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100a890610a16565b60405180910390fd5b3660008037600080366000845af43d6000803e8080156100d0573d6000f35b3d6000fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b60006101036100d5565b905060005b825181101561034557600083828151811061011f57fe5b60209081029190910101515190506001600160a01b038116156102dc576001600160a01b038116600090815260028401602052604090206001015461ffff168015801561018457506001600160a01b0382166000908152600285016020526040902054155b1561020e576101ab82604051806060016040528060248152602001610a4c60249139610391565b5060038301805460018082018355600092835260208084208301805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03871690811790915584526002870190526040909220909101805461ffff191661ffff83161790555b60005b85848151811061021d57fe5b602002602001015160200151518110156102d557600086858151811061023f57fe5b602002602001015160200151828151811061025657fe5b6020908102919091018101516001600160e01b031981166000908152600189019092526040909120549091506001600160a01b03168061029f5761029a85836103d2565b6102cb565b846001600160a01b0316816001600160a01b0316146102cb576102c1826104b2565b6102cb85836103d2565b5050600101610211565b505061033c565b60005b8483815181106102eb57fe5b6020026020010151602001515181101561033a5761033285848151811061030e57fe5b602002602001015160200151828151811061032557fe5b60200260200101516104b2565b6001016102df565b505b50600101610108565b5060408051600080825260208201928390527f39725dd03d877043d78fdfe186295e46e6277eb0a3498f2adb51071f42a2bdcb926103859286929161093f565b60405180910390a15050565b813b81816103cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100a891906109fc565b50505050565b60006103dc6100d5565b6001600160a01b03909316600081815260028501602090815260408083208054600180820183559185528385206008820401805460e08a901c600460078516026101000a90810263ffffffff909102199091161790556001600160e01b03199097168452909601905293909320805461ffff90931674010000000000000000000000000000000000000000027fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff199094169094179290921692909217905550565b60006104bc6100d5565b6001600160e01b0319831660009081526001820160205260409020549091506001600160a01b0316806104f0575050610849565b6001600160e01b0319831660009081526001830160209081526040808320546001600160a01b038516845260028601909252822080547401000000000000000000000000000000000000000090920461ffff16926000198301929091908390811061055757fe5b90600052602060002090600891828204019190066004029054906101000a900460e01b9050857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461067d576001600160a01b038416600090815260028601602052604090208054829190859081106105ea57fe5b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b031983168152600187019091526040902080547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000061ffff8616021790555b6001600160a01b038416600090815260028601602052604090208054806106a057fe5b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319881682526001870190526040902080547fffffffffffffffffffff0000000000000000000000000000000000000000000016905581610843576003850180546000198101916000918390811061072c57fe5b60009182526020808320909101546001600160a01b0389811680855260028c019093526040909320600101549216925061ffff9091169082146107d1578188600301828154811061077957fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03948516179055918416815260028a0190915260409020600101805461ffff191661ffff83161790555b876003018054806107de57fe5b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556001600160a01b038916825260028a0190526040812090610832828261084c565b50600101805461ffff191690555050505b50505050505b50565b50805460008255600701600890049060005260206000209081019061084991905b80821115610881576000815560010161086d565b5090565b6001600160a01b03169052565b6000815180845260208085019450808401835b838110156108cb5781516001600160e01b031916875295820195908201906001016108a5565b509495945050505050565b60008151808452815b818110156108fb576020818501810151868301820152016108df565b8181111561090c5782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060820160608352808651808352608085019150602092506080838202860101838901855b838110156109cf577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80888403018552815160406109a4858351610885565b87820151915080888601526109bb81860183610892565b968801969450505090850190600101610966565b50506109dd84870189610885565b85810360408701526109ef81886108d6565b9998505050505050505050565b600060208252610a0f60208301846108d6565b9392505050565b6020808252818101527f4469616d6f6e643a2046756e6374696f6e20646f6573206e6f7420657869737460408201526060019056fe4c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f6465a264697066735822122012e7ed35b4a2847b23e9d014f8b7b3c729039992cbc88821d0901892d1f6ba3d64736f6c63430007010033608060405234801561001057600080fd5b50610f3c806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063e712b4e114610030575b600080fd5b61004361003e366004610a05565b610045565b005b61004f85856101c2565b7f39725dd03d877043d78fdfe186295e46e6277eb0a3498f2adb51071f42a2bdcb8585858585604051610086959493929190610b83565b60405180910390a16001600160a01b0383166100c85780156100c35760405162461bcd60e51b81526004016100ba90610cea565b60405180910390fd5b6101bb565b806100e55760405162461bcd60e51b81526004016100ba90610d47565b6001600160a01b038316301461011757610117836040518060600160405280602a8152602001610eb7602a91396104b6565b60006060846001600160a01b03168484604051610135929190610b73565b600060405180830381855af49150503d8060008114610170576040519150601f19603f3d011682016040523d82523d6000602084013e610175565b606091505b5091509150816101b8578051156101a0578060405162461bcd60e51b81526004016100ba9190610c60565b60405162461bcd60e51b81526004016100ba90610da4565b50505b5050505050565b60006101cc6104d7565b80549091506001600160a01b031633146101f85760405162461bcd60e51b81526004016100ba90610cb3565b60005b828110156104b057600084848381811061021157fe5b90506020028101906102239190610e4f565b6102319060208101906109e3565b90506001600160a01b03811615610412576001600160a01b038116600090815260028401602052604090206001015461ffff168015801561028a57506001600160a01b0382166000908152600285016020526040902054155b15610314576102b182604051806060016040528060268152602001610ee1602691396104b6565b5060038301805460018082018355600092835260208084208301805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03871690811790915584526002870190526040909220909101805461ffff191661ffff83161790555b60005b86868581811061032357fe5b90506020028101906103359190610e4f565b610343906020810190610e01565b905081101561040b57600087878681811061035a57fe5b905060200281019061036c9190610e4f565b61037a906020810190610e01565b8381811061038457fe5b90506020020160208101906103999190610ad8565b6001600160e01b0319811660009081526001880160205260409020549091506001600160a01b0316806103d5576103d085836104fb565b610401565b846001600160a01b0316816001600160a01b031614610401576103f7826105db565b61040185836104fb565b5050600101610317565b50506104a7565b60005b85858481811061042157fe5b90506020028101906104339190610e4f565b610441906020810190610e01565b90508110156104a55761049d86868581811061045957fe5b905060200281019061046b9190610e4f565b610479906020810190610e01565b8381811061048357fe5b90506020020160208101906104989190610ad8565b6105db565b600101610415565b505b506001016101fb565b50505050565b813b81816104b05760405162461bcd60e51b81526004016100ba9190610c60565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b60006105056104d7565b6001600160a01b03909316600081815260028501602090815260408083208054600180820183559185528385206008820401805460e08a901c600460078516026101000a90810263ffffffff909102199091161790556001600160e01b03199097168452909601905293909320805461ffff90931674010000000000000000000000000000000000000000027fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff199094169094179290921692909217905550565b60006105e56104d7565b6001600160e01b0319831660009081526001820160205260409020549091506001600160a01b031680610619575050610972565b6001600160e01b0319831660009081526001830160209081526040808320546001600160a01b038516845260028601909252822080547401000000000000000000000000000000000000000090920461ffff16926000198301929091908390811061068057fe5b90600052602060002090600891828204019190066004029054906101000a900460e01b9050857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146107a6576001600160a01b0384166000908152600286016020526040902080548291908590811061071357fe5b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b031983168152600187019091526040902080547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000061ffff8616021790555b6001600160a01b038416600090815260028601602052604090208054806107c957fe5b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319881682526001870190526040902080547fffffffffffffffffffff000000000000000000000000000000000000000000001690558161096c576003850180546000198101916000918390811061085557fe5b60009182526020808320909101546001600160a01b0389811680855260028c019093526040909320600101549216925061ffff9091169082146108fa57818860030182815481106108a257fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03948516179055918416815260028a0190915260409020600101805461ffff191661ffff83161790555b8760030180548061090757fe5b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556001600160a01b038916825260028a019052604081209061095b8282610975565b50600101805461ffff191690555050505b50505050505b50565b50805460008255600701600890049060005260206000209081019061097291905b808211156109aa5760008155600101610996565b5090565b80356001600160a01b03811681146109c557600080fd5b92915050565b80356001600160e01b0319811681146109c557600080fd5b6000602082840312156109f4578081fd5b6109fe83836109ae565b9392505050565b600080600080600060608688031215610a1c578081fd5b853567ffffffffffffffff80821115610a33578283fd5b818801915088601f830112610a46578283fd5b813581811115610a54578384fd5b60208a818284028601011115610a68578485fd5b8084019850819750610a7c8b828c016109ae565b965060408a0135935082841115610a91578485fd5b838a0193508a601f850112610aa4578485fd5b8335915082821115610ab4578485fd5b8a81838601011115610ac4578485fd5b979a96995094975050909401935090919050565b600060208284031215610ae9578081fd5b6109fe83836109cb565b6001600160a01b03169052565b60008284526020808501945082825b85811015610b3e578282016001600160e01b0319610b2d82856109cb565b168852968301969150600101610b0f565b509495945050505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b6000828483379101908152919050565b606080825281018590526000602060808084019082890285010189845b8a811015610c31577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808784030184528135603e198d3603018112610be2578687fd5b8c016040868201610bfc86610bf783866109ae565b610af3565b610c068184610e6e565b935090508188870152610c1c8287018483610b00565b96880196955050509185019150600101610ba0565b5050610c3f83860189610af3565b8481036040860152610c52818789610b49565b9a9950505050505050505050565b6000602080835283518082850152825b81811015610c8c57858101830151858201604001528201610c70565b81811115610c9d5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526016908201527f4d757374206f776e2074686520636f6e74726163742e00000000000000000000604082015260600190565b6020808252603e908201527f4469616d6f6e6443757446616365743a205f696e69742069732061646472657360408201527f73283029206275745f63616c6c64617461206973206e6f7420656d7074790000606082015260800190565b6020808252603f908201527f4469616d6f6e6443757446616365743a205f63616c6c6461746120697320656d60408201527f70747920627574205f696e6974206973206e6f74206164647265737328302900606082015260800190565b60208082526028908201527f4469616d6f6e6443757446616365743a205f696e69742066756e6374696f6e2060408201527f7265766572746564000000000000000000000000000000000000000000000000606082015260800190565b6000808335601e19843603018112610e17578283fd5b83018035915067ffffffffffffffff821115610e31578283fd5b6020908101925081023603821315610e4857600080fd5b9250929050565b60008235603e19833603018112610e64578182fd5b9190910192915050565b6000808335601e19843603018112610e84578283fd5b830160208101925035905067ffffffffffffffff811115610ea457600080fd5b602081023603831315610e4857600080fdfe4469616d6f6e6443757446616365743a205f696e6974206164647265737320686173206e6f20636f64654469616d6f6e6443757446616365743a204e657720666163657420686173206e6f20636f6465a2646970667358221220d549925be7f162ad8bee0e5faaf2f9a9e548ed65080d804fbd4dcdb3aa77977264736f6c63430007010033608060405234801561001057600080fd5b5061071f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80637a0ed627116100505780637a0ed627146100aa578063adfca15e146100bf578063cdffacc6146100df57610067565b806301ffc9a71461006c57806352ef6b2c14610095575b600080fd5b61007f61007a36600461050f565b6100ff565b60405161008c91906106de565b60405180910390f35b61009d61014a565b60405161008c91906105cc565b6100b26101c3565b60405161008c9190610639565b6100d26100cd3660046104d4565b610370565b60405161008c9190610626565b6100f26100ed36600461050f565b61043c565b60405161008c91906105ab565b60008061010a610498565b7fffffffff00000000000000000000000000000000000000000000000000000000841660009081526004909101602052604090205460ff16915050919050565b60606000610156610498565b600381018054604080516020808402820181019092528281529394508301828280156101b857602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161018d575b505050505091505090565b606060006101cf610498565b60038101549091508067ffffffffffffffff811180156101ee57600080fd5b5060405190808252806020026020018201604052801561022857816020015b6102156104bc565b81526020019060019003908161020d5790505b50925060005b8181101561036a57600083600301828154811061024757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508085838151811061028157fe5b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff928316905290821660009081526002860182526040908190208054825181850281018501909352808352919290919083018282801561034257602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600401906020826003010492830192600103820291508084116102ef5790505b505050505085838151811061035357fe5b60209081029190910181015101525060010161022e565b50505090565b6060600061037c610498565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600282016020908152604091829020805483518184028101840190945280845293945091929083018282801561042f57602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600401906020826003010492830192600103820291508084116103dc5790505b5050505050915050919050565b600080610447610498565b7fffffffff00000000000000000000000000000000000000000000000000000000909316600090815260019093016020525050604090205473ffffffffffffffffffffffffffffffffffffffff1690565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b60408051808201909152600081526060602082015290565b6000602082840312156104e5578081fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610508578182fd5b9392505050565b600060208284031215610520578081fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610508578182fd5b6000815180845260208085019450808401835b838110156105a05781517fffffffff000000000000000000000000000000000000000000000000000000001687529582019590820190600101610562565b509495945050505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6020808252825182820181905260009190848201906040850190845b8181101561061a57835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016105e8565b50909695505050505050565b600060208252610508602083018461054f565b60208082528251828201819052600091906040908185019080840286018301878501865b838110156106d0578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805173ffffffffffffffffffffffffffffffffffffffff1684528701518784018790526106bd8785018261054f565b958801959350509086019060010161065d565b509098975050505050505050565b90151581526020019056fea2646970667358221220e6bc52eff367bffa184f21fff4b2b1e67b39a7f4ef10559888221813c6c7b50164736f6c63430007010033608060405234801561001057600080fd5b5061025d806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80638da5cb5b1461003b578063f2fde38b14610059575b600080fd5b61004361006e565b60405161005091906101cf565b60405180910390f35b61006c610067366004610194565b610096565b005b600080610079610170565b5473ffffffffffffffffffffffffffffffffffffffff1691505090565b60006100a0610170565b805490915073ffffffffffffffffffffffffffffffffffffffff163381146100fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f4906101f0565b60405180910390fd5b81547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8481169182178455604051908316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b6000602082840312156101a5578081fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146101c8578182fd5b9392505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60208082526016908201527f4d757374206f776e2074686520636f6e74726163742e0000000000000000000060408201526060019056fea2646970667358221220e4ef1d95ebf335ba5234af7aa0a862982465bbdd5e9a39f9552b962ab297b95c64736f6c634300070100334c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f6465",
  "deployedBytecode": "0x60806040523661000b57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d60205260409020547fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9081906001600160a01b0316806100b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100a890610a16565b60405180910390fd5b3660008037600080366000845af43d6000803e8080156100d0573d6000f35b3d6000fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b60006101036100d5565b905060005b825181101561034557600083828151811061011f57fe5b60209081029190910101515190506001600160a01b038116156102dc576001600160a01b038116600090815260028401602052604090206001015461ffff168015801561018457506001600160a01b0382166000908152600285016020526040902054155b1561020e576101ab82604051806060016040528060248152602001610a4c60249139610391565b5060038301805460018082018355600092835260208084208301805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03871690811790915584526002870190526040909220909101805461ffff191661ffff83161790555b60005b85848151811061021d57fe5b602002602001015160200151518110156102d557600086858151811061023f57fe5b602002602001015160200151828151811061025657fe5b6020908102919091018101516001600160e01b031981166000908152600189019092526040909120549091506001600160a01b03168061029f5761029a85836103d2565b6102cb565b846001600160a01b0316816001600160a01b0316146102cb576102c1826104b2565b6102cb85836103d2565b5050600101610211565b505061033c565b60005b8483815181106102eb57fe5b6020026020010151602001515181101561033a5761033285848151811061030e57fe5b602002602001015160200151828151811061032557fe5b60200260200101516104b2565b6001016102df565b505b50600101610108565b5060408051600080825260208201928390527f39725dd03d877043d78fdfe186295e46e6277eb0a3498f2adb51071f42a2bdcb926103859286929161093f565b60405180910390a15050565b813b81816103cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100a891906109fc565b50505050565b60006103dc6100d5565b6001600160a01b03909316600081815260028501602090815260408083208054600180820183559185528385206008820401805460e08a901c600460078516026101000a90810263ffffffff909102199091161790556001600160e01b03199097168452909601905293909320805461ffff90931674010000000000000000000000000000000000000000027fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff199094169094179290921692909217905550565b60006104bc6100d5565b6001600160e01b0319831660009081526001820160205260409020549091506001600160a01b0316806104f0575050610849565b6001600160e01b0319831660009081526001830160209081526040808320546001600160a01b038516845260028601909252822080547401000000000000000000000000000000000000000090920461ffff16926000198301929091908390811061055757fe5b90600052602060002090600891828204019190066004029054906101000a900460e01b9050857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461067d576001600160a01b038416600090815260028601602052604090208054829190859081106105ea57fe5b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b031983168152600187019091526040902080547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000061ffff8616021790555b6001600160a01b038416600090815260028601602052604090208054806106a057fe5b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319881682526001870190526040902080547fffffffffffffffffffff0000000000000000000000000000000000000000000016905581610843576003850180546000198101916000918390811061072c57fe5b60009182526020808320909101546001600160a01b0389811680855260028c019093526040909320600101549216925061ffff9091169082146107d1578188600301828154811061077957fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03948516179055918416815260028a0190915260409020600101805461ffff191661ffff83161790555b876003018054806107de57fe5b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556001600160a01b038916825260028a0190526040812090610832828261084c565b50600101805461ffff191690555050505b50505050505b50565b50805460008255600701600890049060005260206000209081019061084991905b80821115610881576000815560010161086d565b5090565b6001600160a01b03169052565b6000815180845260208085019450808401835b838110156108cb5781516001600160e01b031916875295820195908201906001016108a5565b509495945050505050565b60008151808452815b818110156108fb576020818501810151868301820152016108df565b8181111561090c5782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060820160608352808651808352608085019150602092506080838202860101838901855b838110156109cf577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80888403018552815160406109a4858351610885565b87820151915080888601526109bb81860183610892565b968801969450505090850190600101610966565b50506109dd84870189610885565b85810360408701526109ef81886108d6565b9998505050505050505050565b600060208252610a0f60208301846108d6565b9392505050565b6020808252818101527f4469616d6f6e643a2046756e6374696f6e20646f6573206e6f7420657869737460408201526060019056fe4c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f6465a264697066735822122012e7ed35b4a2847b23e9d014f8b7b3c729039992cbc88821d0901892d1f6ba3d64736f6c63430007010033",
  "linkReferences": {},
  "deployedLinkReferences": {},
  "metadata": "{\"compiler\":{\"version\":\"0.7.1+commit.f4a555be\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.7/diamond/Diamond.sol\":\"Diamond\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":2000},\"remappings\":[]},\"sources\":{\"solc_0.7/diamond/Diamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.7.1;\\npragma experimental ABIEncoderV2;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge\\n*\\n* Implementation of an example of a diamond.\\n/******************************************************************************/\\n\\nimport \\\"./libraries/LibDiamondStorage.sol\\\";\\nimport \\\"./libraries/LibDiamondCut.sol\\\";\\nimport \\\"./facets/OwnershipFacet.sol\\\";\\nimport \\\"./facets/DiamondCutFacet.sol\\\";\\nimport \\\"./facets/DiamondLoupeFacet.sol\\\";\\n\\ncontract Diamond {\\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n    constructor(address owner) payable {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        ds.contractOwner = owner;\\n        emit OwnershipTransferred(address(0), owner);\\n\\n        DiamondCutFacet diamondCutFacet = new DiamondCutFacet();\\n\\n        DiamondLoupeFacet diamondLoupeFacet = new DiamondLoupeFacet();\\n\\n        // Create a OwnershipFacet contract which implements the ERC-173 Ownership interface\\n        OwnershipFacet ownershipFacet = new OwnershipFacet();\\n\\n        IDiamondCut.Facet[] memory diamondCut = new IDiamondCut.Facet[](3);\\n\\n        // adding diamondCut function\\n        diamondCut[0].facetAddress = address(diamondCutFacet);\\n        diamondCut[0].functionSelectors = new bytes4[](1);\\n        diamondCut[0].functionSelectors[0] = DiamondCutFacet.diamondCut.selector;\\n\\n        // adding diamond loupe functions\\n        diamondCut[1].facetAddress = address(diamondLoupeFacet);\\n        diamondCut[1].functionSelectors = new bytes4[](5);\\n        diamondCut[1].functionSelectors[0] = DiamondLoupeFacet.facetFunctionSelectors.selector;\\n        diamondCut[1].functionSelectors[1] = DiamondLoupeFacet.facets.selector;\\n        diamondCut[1].functionSelectors[2] = DiamondLoupeFacet.facetAddress.selector;\\n        diamondCut[1].functionSelectors[3] = DiamondLoupeFacet.facetAddresses.selector;\\n        diamondCut[1].functionSelectors[4] = DiamondLoupeFacet.supportsInterface.selector;\\n\\n        // adding ownership functions\\n        diamondCut[2].facetAddress = address(ownershipFacet);\\n        diamondCut[2].functionSelectors = new bytes4[](2);\\n        diamondCut[2].functionSelectors[0] = OwnershipFacet.transferOwnership.selector;\\n        diamondCut[2].functionSelectors[1] = OwnershipFacet.owner.selector;\\n\\n        // execute non-standard internal diamondCut function to add functions\\n        LibDiamondCut.diamondCut(diamondCut);\\n\\n        // adding ERC165 data\\n        // ERC165\\n        ds.supportedInterfaces[IERC165.supportsInterface.selector] = true;\\n\\n        // DiamondCut\\n        ds.supportedInterfaces[DiamondCutFacet.diamondCut.selector] = true;\\n\\n        // DiamondLoupe\\n        bytes4 interfaceID = IDiamondLoupe.facets.selector ^\\n            IDiamondLoupe.facetFunctionSelectors.selector ^\\n            IDiamondLoupe.facetAddresses.selector ^\\n            IDiamondLoupe.facetAddress.selector;\\n        ds.supportedInterfaces[interfaceID] = true;\\n\\n        // ERC173\\n        ds.supportedInterfaces[IERC173.transferOwnership.selector ^ IERC173.owner.selector] = true;\\n    }\\n\\n    // Find facet for function that is called and execute the\\n    // function if a facet is found and return any value.\\n    fallback() external payable {\\n        LibDiamondStorage.DiamondStorage storage ds;\\n        bytes32 position = LibDiamondStorage.DIAMOND_STORAGE_POSITION;\\n        assembly {\\n            ds.slot := position\\n        }\\n        address facet = ds.selectorToFacetAndPosition[msg.sig].facetAddress;\\n        require(facet != address(0), \\\"Diamond: Function does not exist\\\");\\n        assembly {\\n            calldatacopy(0, 0, calldatasize())\\n            let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0)\\n            returndatacopy(0, 0, returndatasize())\\n            switch result\\n                case 0 {\\n                    revert(0, returndatasize())\\n                }\\n                default {\\n                    return(0, returndatasize())\\n                }\\n        }\\n    }\\n\\n    receive() external payable {}\\n}\\n\",\"keccak256\":\"0x5d2e73e1c35ca41c6164e04a56398470a65f7c259613dc85b786a4bece4f781d\",\"license\":\"MIT\"},\"solc_0.7/diamond/facets/DiamondCutFacet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.7.1;\\npragma experimental ABIEncoderV2;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)\\n*\\n* Implementation of diamondCut external function.\\n/******************************************************************************/\\n\\nimport \\\"../libraries/LibDiamondStorage.sol\\\";\\nimport \\\"../interfaces/IDiamondCut.sol\\\";\\nimport \\\"../libraries/LibDiamondCut.sol\\\";\\n\\ncontract DiamondCutFacet is IDiamondCut {\\n    // Standard diamondCut external function\\n    /// @notice Add/replace/remove any number of functions and optionally execute\\n    ///         a function with delegatecall\\n    /// @param _diamondCut Contains the facet addresses and function selectors\\n    /// @param _init The address of the contract or facet to execute _calldata\\n    /// @param _calldata A function call, including function selector and arguments\\n    ///                  _calldata is executed with delegatecall on _init\\n    function diamondCut(\\n        Facet[] calldata _diamondCut,\\n        address _init,\\n        bytes calldata _calldata\\n    ) external override {\\n        externalCut(_diamondCut);\\n        emit DiamondCut(_diamondCut, _init, _calldata);\\n        if (_init == address(0)) {\\n            require(_calldata.length == 0, \\\"DiamondCutFacet: _init is address(0) but_calldata is not empty\\\");\\n        } else {\\n            require(_calldata.length > 0, \\\"DiamondCutFacet: _calldata is empty but _init is not address(0)\\\");\\n            if (_init != address(this)) {\\n                LibDiamondCut.hasContractCode(_init, \\\"DiamondCutFacet: _init address has no code\\\");\\n            }\\n            (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n            if (!success) {\\n                if (error.length > 0) {\\n                    // bubble up the error\\n                    revert(string(error));\\n                } else {\\n                    revert(\\\"DiamondCutFacet: _init function reverted\\\");\\n                }\\n            }\\n        }\\n    }\\n\\n    // diamondCut helper function\\n    // This code is almost the same as the internal diamondCut function,\\n    // except it is using 'Facets[] calldata _diamondCut' instead of\\n    // 'Facet[] memory _diamondCut', and it does not issue the DiamondCut event.\\n    // The code is duplicated to prevent copying calldata to memory which\\n    // causes a Solidity error for two dimensional arrays.\\n    function externalCut(Facet[] calldata _diamondCut) internal {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        require(msg.sender == ds.contractOwner, \\\"Must own the contract.\\\");\\n        for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {\\n            address newFacetAddress = _diamondCut[facetIndex].facetAddress;\\n            // add or replace function\\n            if (newFacetAddress != address(0)) {\\n                uint256 facetAddressPosition = ds.facetFunctionSelectors[newFacetAddress].facetAddressPosition;\\n                // add new facet address if it does not exist\\n                if (facetAddressPosition == 0 && ds.facetFunctionSelectors[newFacetAddress].functionSelectors.length == 0) {\\n                    LibDiamondCut.hasContractCode(newFacetAddress, \\\"DiamondCutFacet: New facet has no code\\\");\\n                    facetAddressPosition = ds.facetAddresses.length;\\n                    ds.facetAddresses.push(newFacetAddress);\\n                    ds.facetFunctionSelectors[newFacetAddress].facetAddressPosition = uint16(facetAddressPosition);\\n                }\\n                // add or replace selectors\\n                for (uint256 selectorIndex; selectorIndex < _diamondCut[facetIndex].functionSelectors.length; selectorIndex++) {\\n                    bytes4 selector = _diamondCut[facetIndex].functionSelectors[selectorIndex];\\n                    address oldFacet = ds.selectorToFacetAndPosition[selector].facetAddress;\\n                    // add\\n                    if (oldFacet == address(0)) {\\n                        LibDiamondCut.addSelector(newFacetAddress, selector);\\n                    } else {\\n                        // replace\\n                        if (oldFacet != newFacetAddress) {\\n                            LibDiamondCut.removeSelector(selector);\\n                            LibDiamondCut.addSelector(newFacetAddress, selector);\\n                        }\\n                    }\\n                }\\n            } else {\\n                // remove selectors\\n                for (uint256 selectorIndex; selectorIndex < _diamondCut[facetIndex].functionSelectors.length; selectorIndex++) {\\n                    LibDiamondCut.removeSelector(_diamondCut[facetIndex].functionSelectors[selectorIndex]);\\n                }\\n            }\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0xe5cefda560bdf00d7e412ef747e28f2076d07b32221ccdfaa607aaab0ca30029\",\"license\":\"MIT\"},\"solc_0.7/diamond/facets/DiamondLoupeFacet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.7.1;\\npragma experimental ABIEncoderV2;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)\\n*\\n* Implementation of DiamondLoupe interface.\\n/******************************************************************************/\\n\\nimport \\\"../libraries/LibDiamondStorage.sol\\\";\\nimport \\\"../interfaces/IDiamondCut.sol\\\";\\nimport \\\"../interfaces/IDiamondLoupe.sol\\\";\\nimport \\\"../interfaces/IERC165.sol\\\";\\n\\ncontract DiamondLoupeFacet is IDiamondLoupe, IERC165 {\\n    // Diamond Loupe Functions\\n    ////////////////////////////////////////////////////////////////////\\n    /// These functions are expected to be called frequently\\n    /// by tools. Therefore the return values are tightly\\n    /// packed for efficiency. That means no padding with zeros.\\n\\n    // struct Facet {\\n    //     address facetAddress;\\n    //     bytes4[] functionSelectors;\\n    // }\\n\\n    /// @notice Gets all facets and their selectors.\\n    /// @return facets_ Facet\\n    function facets() external override view returns (Facet[] memory facets_) {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        uint256 numFacets = ds.facetAddresses.length;\\n        facets_ = new Facet[](numFacets);\\n        for (uint256 i; i < numFacets; i++) {\\n            address facetAddress = ds.facetAddresses[i];\\n            facets_[i].facetAddress = facetAddress;\\n            facets_[i].functionSelectors = ds.facetFunctionSelectors[facetAddress].functionSelectors;\\n        }\\n    }\\n\\n    /// @notice Gets all the function selectors provided by a facet.\\n    /// @param _facet The facet address.\\n    /// @return facetFunctionSelectors_\\n    function facetFunctionSelectors(address _facet) external override view returns (bytes4[] memory facetFunctionSelectors_) {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        facetFunctionSelectors_ = ds.facetFunctionSelectors[_facet].functionSelectors;\\n    }\\n\\n    /// @notice Get all the facet addresses used by a diamond.\\n    /// @return facetAddresses_\\n    function facetAddresses() external override view returns (address[] memory facetAddresses_) {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        facetAddresses_ = ds.facetAddresses;\\n    }\\n\\n    /// @notice Gets the facet that supports the given selector.\\n    /// @dev If facet is not found return address(0).\\n    /// @param _functionSelector The function selector.\\n    /// @return facetAddress_ The facet address.\\n    function facetAddress(bytes4 _functionSelector) external override view returns (address facetAddress_) {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        facetAddress_ = ds.selectorToFacetAndPosition[_functionSelector].facetAddress;\\n    }\\n\\n    // This implements ERC-165.\\n    function supportsInterface(bytes4 _interfaceId) external override view returns (bool) {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        return ds.supportedInterfaces[_interfaceId];\\n    }\\n}\\n\",\"keccak256\":\"0x4b7366bd3fe648aaa728031852007fa2fb83da852a99fb9914ca00ace29453a0\",\"license\":\"MIT\"},\"solc_0.7/diamond/facets/OwnershipFacet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.7.1;\\npragma experimental ABIEncoderV2;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)\\n/******************************************************************************/\\n\\nimport \\\"../libraries/LibDiamondStorage.sol\\\";\\nimport \\\"../interfaces/IERC173.sol\\\";\\n\\ncontract OwnershipFacet is IERC173 {\\n    function transferOwnership(address newOwner) external override {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        address currentOwner = ds.contractOwner;\\n        require(msg.sender == currentOwner, \\\"Must own the contract.\\\");\\n        ds.contractOwner = newOwner;\\n        emit OwnershipTransferred(currentOwner, newOwner);\\n    }\\n\\n    function owner() external override view returns (address) {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        return ds.contractOwner;\\n    }\\n}\\n\",\"keccak256\":\"0xe09014d34261a3f4275e5a8e0f7081fe576bc0e4cb15a4760df156a9b423e579\",\"license\":\"MIT\"},\"solc_0.7/diamond/interfaces/IDiamondCut.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.7.1;\\npragma experimental ABIEncoderV2;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)\\n/******************************************************************************/\\n\\ninterface IDiamondCut {\\n    struct Facet {\\n        address facetAddress;\\n        bytes4[] functionSelectors;\\n    }\\n\\n    /// @notice Add/replace/remove any number of functions and optionally execute\\n    ///         a function with delegatecall\\n    /// @param _diamondCut Contains the facet addresses and function selectors\\n    /// @param _init The address of the contract or facet to execute _calldata\\n    /// @param _calldata A function call, including function selector and arguments\\n    ///                  _calldata is executed with delegatecall on _init\\n    function diamondCut(\\n        Facet[] calldata _diamondCut,\\n        address _init,\\n        bytes calldata _calldata\\n    ) external;\\n\\n    event DiamondCut(Facet[] _diamondCut, address _init, bytes _calldata);\\n}\\n\",\"keccak256\":\"0xba9cbedda8b486e17512639ee5ca6a4de1638b55c26b130e61cbbaa632acdef5\",\"license\":\"MIT\"},\"solc_0.7/diamond/interfaces/IDiamondLoupe.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.7.1;\\npragma experimental ABIEncoderV2;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)\\n/******************************************************************************/\\n\\n// A loupe is a small magnifying glass used to look at diamonds.\\n// These functions look at diamonds\\ninterface IDiamondLoupe {\\n    /// These functions are expected to be called frequently\\n    /// by tools.\\n\\n    struct Facet {\\n        address facetAddress;\\n        bytes4[] functionSelectors;\\n    }\\n\\n    /// @notice Gets all facet addresses and their four byte function selectors.\\n    /// @return facets_ Facet\\n    function facets() external view returns (Facet[] memory facets_);\\n\\n    /// @notice Gets all the function selectors supported by a specific facet.\\n    /// @param _facet The facet address.\\n    /// @return facetFunctionSelectors_\\n    function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_);\\n\\n    /// @notice Get all the facet addresses used by a diamond.\\n    /// @return facetAddresses_\\n    function facetAddresses() external view returns (address[] memory facetAddresses_);\\n\\n    /// @notice Gets the facet that supports the given selector.\\n    /// @dev If facet is not found return address(0).\\n    /// @param _functionSelector The function selector.\\n    /// @return facetAddress_ The facet address.\\n    function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);\\n}\\n\",\"keccak256\":\"0xde77c3530df288849ad2cc13a6a1a00b0216c019875b153a929b3e770667f07d\",\"license\":\"MIT\"},\"solc_0.7/diamond/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.7.1;\\npragma experimental ABIEncoderV2;\\n\\ninterface IERC165 {\\n    /// @notice Query if a contract implements an interface\\n    /// @param interfaceId The interface identifier, as specified in ERC-165\\n    /// @dev Interface identification is specified in ERC-165. This function\\n    ///  uses less than 30,000 gas.\\n    /// @return `true` if the contract implements `interfaceID` and\\n    ///  `interfaceID` is not 0xffffffff, `false` otherwise\\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc19b99fbeaeb943b6d12e6d631b6ae1738aaa498ee49f67caaccc6238fd0d458\",\"license\":\"MIT\"},\"solc_0.7/diamond/interfaces/IERC173.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.7.1;\\npragma experimental ABIEncoderV2;\\n\\n/// @title ERC-173 Contract Ownership Standard\\n///  Note: the ERC-165 identifier for this interface is 0x7f5828d0\\n/* is ERC165 */\\ninterface IERC173 {\\n    /// @dev This emits when ownership of a contract changes.\\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n    /// @notice Get the address of the owner\\n    /// @return The address of the owner.\\n    function owner() external view returns (address);\\n\\n    /// @notice Set the address of the new owner of the contract\\n    /// @dev Set _newOwner to address(0) to renounce any ownership.\\n    /// @param _newOwner The address of the new owner of the contract\\n    function transferOwnership(address _newOwner) external;\\n}\\n\",\"keccak256\":\"0xdb5c5f069a9337daa33b88c6c9fe72edb31b9ff91bf4a923caf02cb9e95d4b12\",\"license\":\"MIT\"},\"solc_0.7/diamond/libraries/LibDiamondCut.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.7.1;\\npragma experimental ABIEncoderV2;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)\\n*\\n* Implementation of internal diamondCut function.\\n/******************************************************************************/\\n\\nimport \\\"./LibDiamondStorage.sol\\\";\\nimport \\\"../interfaces/IDiamondCut.sol\\\";\\n\\nlibrary LibDiamondCut {\\n    event DiamondCut(IDiamondCut.Facet[] _diamondCut, address _init, bytes _calldata);\\n\\n    // Non-standard internal function version of diamondCut\\n    // This code is almost the same as externalCut, except it is using\\n    // 'Facet[] memory _diamondCut' instead of 'Facet[] calldata _diamondCut'\\n    // and it DOES issue the DiamondCut event\\n    // The code is duplicated to prevent copying calldata to memory which\\n    // causes a Solidity error for a two dimensional array.\\n    function diamondCut(IDiamondCut.Facet[] memory _diamondCut) internal {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {\\n            address newFacetAddress = _diamondCut[facetIndex].facetAddress;\\n            // add or replace function\\n            if (newFacetAddress != address(0)) {\\n                uint256 facetAddressPosition = ds.facetFunctionSelectors[newFacetAddress].facetAddressPosition;\\n                // add new facet address if it does not exist\\n                if (facetAddressPosition == 0 && ds.facetFunctionSelectors[newFacetAddress].functionSelectors.length == 0) {\\n                    hasContractCode(newFacetAddress, \\\"LibDiamondCut: New facet has no code\\\");\\n                    facetAddressPosition = ds.facetAddresses.length;\\n                    ds.facetAddresses.push(newFacetAddress);\\n                    ds.facetFunctionSelectors[newFacetAddress].facetAddressPosition = uint16(facetAddressPosition);\\n                }\\n                // add or replace selectors\\n                for (uint256 selectorIndex; selectorIndex < _diamondCut[facetIndex].functionSelectors.length; selectorIndex++) {\\n                    bytes4 selector = _diamondCut[facetIndex].functionSelectors[selectorIndex];\\n                    address oldFacet = ds.selectorToFacetAndPosition[selector].facetAddress;\\n                    // add\\n                    if (oldFacet == address(0)) {\\n                        addSelector(newFacetAddress, selector);\\n                    } else {\\n                        // replace\\n                        if (oldFacet != newFacetAddress) {\\n                            removeSelector(selector);\\n                            addSelector(newFacetAddress, selector);\\n                        }\\n                    }\\n                }\\n            } else {\\n                // remove selectors\\n                for (uint256 selectorIndex; selectorIndex < _diamondCut[facetIndex].functionSelectors.length; selectorIndex++) {\\n                    removeSelector(_diamondCut[facetIndex].functionSelectors[selectorIndex]);\\n                }\\n            }\\n        }\\n        emit DiamondCut(_diamondCut, address(0), new bytes(0));\\n    }\\n\\n    function addSelector(address _newFacet, bytes4 _selector) internal {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        uint256 selectorPosition = ds.facetFunctionSelectors[_newFacet].functionSelectors.length;\\n        ds.facetFunctionSelectors[_newFacet].functionSelectors.push(_selector);\\n        ds.selectorToFacetAndPosition[_selector].facetAddress = _newFacet;\\n        ds.selectorToFacetAndPosition[_selector].functionSelectorPosition = uint16(selectorPosition);\\n    }\\n\\n    function removeSelector(bytes4 _selector) internal {\\n        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();\\n        address oldFacet = ds.selectorToFacetAndPosition[_selector].facetAddress;\\n        // if function does not exist then do nothing and return\\n        if (oldFacet == address(0)) {\\n            return;\\n        }\\n        // replace selector with last selector, then delete last selector\\n        uint256 selectorPosition = ds.selectorToFacetAndPosition[_selector].functionSelectorPosition;\\n        uint256 lastSelectorPosition = ds.facetFunctionSelectors[oldFacet].functionSelectors.length - 1;\\n        bytes4 lastSelector = ds.facetFunctionSelectors[oldFacet].functionSelectors[lastSelectorPosition];\\n        // if not the same then replace _selector with lastSelector\\n        if (lastSelector != _selector) {\\n            ds.facetFunctionSelectors[oldFacet].functionSelectors[selectorPosition] = lastSelector;\\n            ds.selectorToFacetAndPosition[lastSelector].functionSelectorPosition = uint16(selectorPosition);\\n        }\\n        // delete the last selector\\n        ds.facetFunctionSelectors[oldFacet].functionSelectors.pop();\\n        delete ds.selectorToFacetAndPosition[_selector];\\n\\n        // if no more selectors for facet address then delete the facet address\\n        if (lastSelectorPosition == 0) {\\n            // replace facet address with last facet address and delete last facet address\\n            uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;\\n            address lastFacetAddress = ds.facetAddresses[lastFacetAddressPosition];\\n            uint256 facetAddressPosition = ds.facetFunctionSelectors[oldFacet].facetAddressPosition;\\n            if (oldFacet != lastFacetAddress) {\\n                ds.facetAddresses[facetAddressPosition] = lastFacetAddress;\\n                ds.facetFunctionSelectors[lastFacetAddress].facetAddressPosition = uint16(facetAddressPosition);\\n            }\\n            ds.facetAddresses.pop();\\n            delete ds.facetFunctionSelectors[oldFacet];\\n        }\\n    }\\n\\n    function hasContractCode(address _contract, string memory _errorMessage) internal view {\\n        uint256 contractSize;\\n        assembly {\\n            contractSize := extcodesize(_contract)\\n        }\\n        require(contractSize > 0, _errorMessage);\\n    }\\n}\\n\",\"keccak256\":\"0x2b0552b7626a43189f62e6b8e7ac6e257a0d6ebe6f03a44d2da12c931a96155b\",\"license\":\"MIT\"},\"solc_0.7/diamond/libraries/LibDiamondStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.7.1;\\npragma experimental ABIEncoderV2;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)\\n/******************************************************************************/\\n\\nlibrary LibDiamondStorage {\\n    bytes32 constant DIAMOND_STORAGE_POSITION = keccak256(\\\"diamond.standard.diamond.storage\\\");\\n\\n    struct FacetAddressAndPosition {\\n        address facetAddress;\\n        uint16 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array\\n    }\\n\\n    struct FacetFunctionSelectors {\\n        bytes4[] functionSelectors;\\n        uint16 facetAddressPosition; // position of facetAddress in facetAddresses array\\n    }\\n\\n    struct DiamondStorage {\\n        // owner of the contract\\n        address contractOwner;\\n        // maps function selector to the facet address and        \\n        // the position of the selector in the facetFunctionSelectors.selectors array\\n        mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;\\n        // maps facet addresses to function selectors\\n        mapping(address => FacetFunctionSelectors) facetFunctionSelectors;\\n        // facet addresses\\n        address[] facetAddresses;\\n        // Used to query if a contract implements an interface.\\n        // Used to implement ERC-165.\\n        mapping(bytes4 => bool) supportedInterfaces;\\n    }\\n\\n    function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n        bytes32 position = DIAMOND_STORAGE_POSITION;\\n        assembly {\\n            ds.slot := position\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0xe775d2cb83a52f9bc6341b6331acd86527a7870dca3193cfcad3db6206017ed2\",\"license\":\"MIT\"}},\"version\":1}",
  "contractFilepath": "solc_0.7/diamond/Diamond.sol",
  "methodIdentifiers": {},
  "gasEstimates": {
    "creation": {
      "codeDepositCost": "545000",
      "executionCost": "infinite",
      "totalCost": "infinite"
    },
    "external": {
      "": "infinite"
    }
  },
  "storageLayout": {
    "storage": [],
    "types": null
  },
  "userdoc": {
    "kind": "user",
    "methods": {},
    "version": 1
  },
  "devdoc": {
    "kind": "dev",
    "methods": {},
    "version": 1
  }
}