From ba59ac91d7d5c90f1f4be7c7ed53e8bf6ec3d3c3 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 20 Aug 2024 15:26:19 +0200 Subject: [PATCH] Updates marketplace contract --- .../Marketplace/Marketplace.cs | 32 ++++++++++++++++++- .../CodexTests/BasicTests/MarketplaceTests.cs | 8 +++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/ProjectPlugins/CodexContractsPlugin/Marketplace/Marketplace.cs b/ProjectPlugins/CodexContractsPlugin/Marketplace/Marketplace.cs index feb9518..a757238 100644 --- a/ProjectPlugins/CodexContractsPlugin/Marketplace/Marketplace.cs +++ b/ProjectPlugins/CodexContractsPlugin/Marketplace/Marketplace.cs @@ -15,7 +15,7 @@ namespace CodexContractsPlugin.Marketplace public class MarketplaceDeploymentBase : ContractDeploymentMessage { - public static string BYTECODE = "0x60c06040523480156200001157600080fd5b5060405162003c9b38038062003c9b833981016040819052620000349162000487565b60208301518051608052816101004311620000965760405162461bcd60e51b815260206004820152601960248201527f496e73756666696369656e7420626c6f636b206865696768740000000000000060448201526064015b60405180910390fd5b81516000908155602083015160015560408301516002805460ff191660ff9092169190911790556060830151839190600390620000d4908262000627565b5050600480546001600160a01b0319166001600160a01b0393841617905550831660a05250825151606460ff9091161115620001535760405162461bcd60e51b815260206004820152601560248201527f4d757374206265206c657373207468616e20313030000000000000000000000060448201526064016200008d565b606483600001516060015160ff161115620001b15760405162461bcd60e51b815260206004820152601560248201527f4d757374206265206c657373207468616e20313030000000000000000000000060448201526064016200008d565b82516060810151602090910151606491620001cc91620006f3565b60ff1611156200021f5760405162461bcd60e51b815260206004820152601d60248201527f4d6178696d756d20736c617368696e672065786365656473203130302500000060448201526064016200008d565b82518051600c805460208085015160408087015160609788015160ff9081166401000000000260ff60201b1961ffff90931662010000029290921664ffffff0000199482166101000261ffff1990971698821698909817959095179290921695909517178355808801518051600d90815591810151600e5593840151600f80549190931660ff19919091161790915592820151869391929190601090620002c7908262000627565b50505090505050505062000725565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715620003115762000311620002d6565b60405290565b604080519081016001600160401b0381118282101715620003115762000311620002d6565b604051601f8201601f191681016001600160401b0381118282101715620003675762000367620002d6565b604052919050565b805160ff811681146200038157600080fd5b919050565b6000608082840312156200039957600080fd5b620003a3620002ec565b90508151815260208083015181830152620003c1604084016200036f565b604083015260608301516001600160401b0380821115620003e157600080fd5b818501915085601f830112620003f657600080fd5b8151818111156200040b576200040b620002d6565b6200041f601f8201601f191685016200033c565b915080825286848285010111156200043657600080fd5b60005b818110156200045657838101850151838201860152840162000439565b5060008482840101525080606085015250505092915050565b80516001600160a01b03811681146200038157600080fd5b6000806000606084860312156200049d57600080fd5b83516001600160401b0380821115620004b557600080fd5b9085019081870360a0811215620004cb57600080fd5b620004d562000317565b6080821215620004e457600080fd5b620004ee620002ec565b9150620004fb846200036f565b82526200050b602085016200036f565b6020830152604084015161ffff811681146200052657600080fd5b604083015262000539606085016200036f565b6060830152908152608083015190828211156200055557600080fd5b620005638983860162000386565b6020820152809650505050506200057d602085016200046f565b91506200058d604085016200046f565b90509250925092565b600181811c90821680620005ab57607f821691505b602082108103620005cc57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000622576000816000526020600020601f850160051c81016020861015620005fd5750805b601f850160051c820191505b818110156200061e5782815560010162000609565b5050505b505050565b81516001600160401b03811115620006435762000643620002d6565b6200065b8162000654845462000596565b84620005d2565b602080601f8311600181146200069357600084156200067a5750858301515b600019600386901b1c1916600185901b1785556200061e565b600085815260208120601f198616915b82811015620006c457888601518255948401946001909101908401620006a3565b5085821015620006e35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60ff81811683821602908116908181146200071e57634e487b7160e01b600052601160045260246000fd5b5092915050565b60805160a05161352d6200076e600039600081816103ca01528181610bc001528181611d59015281816120de015261224a0152600081816126670152612806015261352d6000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c80639777b72c116100d8578063be5cdc481161008c578063f752196b11610066578063f752196b14610388578063fb1e61ca146103a8578063fc0c546a146103c857600080fd5b8063be5cdc4814610342578063c0cc4add14610362578063e8aa0a071461037557600080fd5b8063a3a0807e116100bd578063a3a0807e146102ec578063a6af384b1461030f578063b396dc791461032257600080fd5b80639777b72c146102d1578063a29c29a4146102d957600080fd5b80634641dce61161013a5780636b00c8cf116101145780636b00c8cf146102655780636e2b54ee146102a957806379502c55146102bc57600080fd5b80634641dce61461021857806359cc89ed1461023d5780635da738351461025057600080fd5b806308695fcd1161016b57806308695fcd146101cd578063329b5a0b146101e2578063458d2bf11461020557600080fd5b806302fa8e651461018757806305b90773146101ad575b600080fd5b61019a610195366004612a3c565b6103ee565b6040519081526020015b60405180910390f35b6101c06101bb366004612a3c565b610465565b6040516101a49190612a6b565b6101e06101db366004612a85565b610557565b005b61019a6101f0366004612a3c565b60009081526012602052604090206005015490565b61019a610213366004612a3c565b6106ad565b61022b610226366004612a3c565b6106c6565b60405160ff90911681526020016101a4565b6101e061024b366004612aba565b6106d9565b6102586109dd565b6040516101a49190612af1565b610291610273366004612a3c565b6000908152601360205260409020600501546001600160a01b031690565b6040516001600160a01b0390911681526020016101a4565b6101e06102b7366004612a3c565b610a04565b6102c4610c41565b6040516101a49190612b7b565b610258610db2565b6101e06102e7366004612a3c565b610dd1565b6102ff6102fa366004612a3c565b610fa2565b60405190151581526020016101a4565b6101e061031d366004612bfd565b610fd7565b610335610330366004612a3c565b611240565b6040516101a49190612d06565b610355610350366004612a3c565b611429565b6040516101a49190612d38565b6102ff610370366004612a3c565b6114f7565b6101e0610383366004612d4c565b61150a565b61019a610396366004612a3c565b60009081526007602052604090205490565b6103bb6103b6366004612a3c565b611647565b6040516101a49190612d7a565b7f0000000000000000000000000000000000000000000000000000000000000000610291565b6000818152601260205260408120600401548161040a84610465565b9050600081600481111561042057610420612a55565b148061043d5750600181600481111561043b5761043b612a55565b145b15610449575092915050565b61045d82610458600142612da3565b6117fe565b949350505050565b60008181526011602052604081205482906001600160a01b03166104c25760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064015b60405180910390fd5b600083815260126020526040812090815460ff1660048111156104e7576104e7612a55565b148015610504575060008481526012602052604090206005015442115b15610513576002925050610551565b6001815460ff16600481111561052b5761052b612a55565b14801561053b5750806004015442115b1561054a576003925050610551565b5460ff1691505b50919050565b600161056283611429565b600581111561057357610573612a55565b146105c05760405162461bcd60e51b815260206004820152601960248201527f536c6f74206e6f7420616363657074696e672070726f6f66730000000000000060448201526064016104b9565b6105ca8282611816565b6000828152601360209081526040808320600181015484526011909252909120600c5461ffff620100009091041661060e8560009081526007602052604090205490565b6106189190612dcc565b6000036106a757600c54600682015460009160649161064291640100000000900460ff1690612de0565b61064c9190612df7565b9050808360040160008282546106629190612da3565b9091555050600c54600086815260076020526040902054610100820460ff169162010000900461ffff16906106979190612df7565b106106a5576106a585611a43565b505b50505050565b60006106c0826106bb611be9565b611bf4565b92915050565b60006106c0826106d4611be9565b611c08565b60008381526011602052604090205483906001600160a01b03166107315760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064016104b9565b6000848152601160205260409020600181015467ffffffffffffffff16841061079c5760405162461bcd60e51b815260206004820152600c60248201527f496e76616c696420736c6f74000000000000000000000000000000000000000060448201526064016104b9565b60408051602080820188905281830187905282518083038401815260609092019092528051910120600090600081815260136020526040812060018101899055600381018890559192506107ef83611429565b600581111561080057610800612a55565b1461084d5760405162461bcd60e51b815260206004820152601060248201527f536c6f74206973206e6f7420667265650000000000000000000000000000000060448201526064016104b9565b600483015460008381526005602090815260408083204290556006909152902055610878828661150a565b60058101805473ffffffffffffffffffffffffffffffffffffffff191633179055805460ff1916600190811782554260028301556000888152601260205260408120808301805491939290916108cf908490612e0b565b909155506108df90508842611c74565b8160020160008282546108f29190612da3565b909155505060068401546109063382611d11565b806014600001600082825461091b9190612e0b565b909155505060048301819055600583015461093f906001600160a01b031685611e19565b887ff530852268993f91008f1a1e0b09b5c813acd4188481f1fa83c33c7182e814b48960405161097191815260200190565b60405180910390a26001808601549083015467ffffffffffffffff90911690036109d257815460ff1916600117825542600383015560405189907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a25b505050505050505050565b336000908152600b602052604090206060906109ff906109fc90611e3b565b90565b905090565b60008181526011602090815260408083206012909252909120600501544211610a6f5760405162461bcd60e51b815260206004820152601960248201527f52657175657374206e6f74207965742074696d6564206f75740000000000000060448201526064016104b9565b80546001600160a01b03163314610ac85760405162461bcd60e51b815260206004820152601660248201527f496e76616c696420636c69656e7420616464726573730000000000000000000060448201526064016104b9565b600082815260126020526040812090815460ff166004811115610aed57610aed612a55565b14610b3a5760405162461bcd60e51b815260206004820152600d60248201527f496e76616c69642073746174650000000000000000000000000000000000000060448201526064016104b9565b805460ff191660021781558154610b5a906001600160a01b031684611e48565b60405183907ff903f4774c7bd27355f9d7fcbc382b079b164a697a44ac5d95267a4c3cb3bb2290600090a2600281015460158054829190600090610b9f908490612e0b565b909155505060405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c359190612e1e565b6106a7576106a7612e40565b610c986040805160c0810182526000918101828152606082018390526080820183905260a0820192909252908190815260408051608081018252600080825260208281018290529282015260608082015291015290565b6040805160c081018252600c805460ff8082168486019081526101008304821660608087019190915261ffff62010000850416608080880191909152640100000000909404831660a087015290855285519283018652600d80548452600e54602085810191909152600f54909316968401969096526010805495969495928701949291840191610d2790612e56565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5390612e56565b8015610da05780601f10610d7557610100808354040283529160200191610da0565b820191906000526020600020905b815481529060010190602001808311610d8357829003601f168201915b50505050508152505081525050905090565b336000908152600a602052604090206060906109ff906109fc90611e3b565b806000808281526013602052604090205460ff166005811115610df657610df6612a55565b03610e325760405162461bcd60e51b815260206004820152600c60248201526b536c6f74206973206672656560a01b60448201526064016104b9565b600082815260136020526040902060058101546001600160a01b03163314610e9c5760405162461bcd60e51b815260206004820152601960248201527f536c6f742066696c6c6564206279206f7468657220686f73740000000000000060448201526064016104b9565b6000610ea784611429565b90506004816005811115610ebd57610ebd612a55565b03610f0a5760405162461bcd60e51b815260206004820152600c60248201527f416c72656164792070616964000000000000000000000000000000000000000060448201526064016104b9565b6002816005811115610f1e57610f1e612a55565b03610f3657610f31826001015485611e6a565b6106a7565b6005816005811115610f4a57610f4a612a55565b03610f5d57610f31826001015485612157565b6003816005811115610f7157610f71612a55565b03610f8057610f3133856122c3565b6001816005811115610f9457610f94612a55565b036106a7576106a784611a43565b6000806000610fb884610fb3611be9565b6122e5565b909250905081801561045d575060025460ff9081169116109392505050565b33610fe56020830183612ea2565b6001600160a01b03161461103b5760405162461bcd60e51b815260206004820152601660248201527f496e76616c696420636c69656e7420616464726573730000000000000000000060448201526064016104b9565b600061104e61104983613034565b6123c8565b6000818152601160205260409020549091506001600160a01b0316156110b65760405162461bcd60e51b815260206004820152601660248201527f5265717565737420616c7265616479206578697374730000000000000000000060448201526064016104b9565b60008261012001351180156110d357506060820135610120830135105b61111f5760405162461bcd60e51b815260206004820152601360248201527f457870697279206e6f7420696e2072616e67650000000000000000000000000060448201526064016104b9565b600081815260116020526040902082906111398282613291565b5061114a9050606083013542612e0b565b60008281526012602052604090206004015561116b61012083013542612e0b565b6000828152601260209081526040909120600501919091556111999061119390840184612ea2565b826123f8565b60006111ac6111a784613034565b61241a565b60008381526012602052604081206002018290556014805492935083929091906111d7908490612e0b565b909155506111e790503382611d11565b7f5fdb86c365a247a4d97dcbcc5c3abde9d6e3e2de26273f3fda8eef5073b9a96c8284602001601260008681526020019081526020016000206005015460405161123393929190613389565b60405180910390a1505050565b611248612974565b816000808281526013602052604090205460ff16600581111561126d5761126d612a55565b036112a95760405162461bcd60e51b815260206004820152600c60248201526b536c6f74206973206672656560a01b60448201526064016104b9565b60008381526013602052604090206112bf612974565b600180830154600090815260116020908152604091829020825160a0808201855282546001600160a01b03168252845160e0810186529583015467ffffffffffffffff9081168752600284015487860152600384015487870152600484015460608801526005840154608088015260068401549187019190915260078301541660c086015291820193909352815180830183526008840180549294938501928290829061136b90612e56565b80601f016020809104026020016040519081016040528092919081815260200182805461139790612e56565b80156113e45780601f106113b9576101008083540402835291602001916113e4565b820191906000526020600020905b8154815290600101906020018083116113c757829003601f168201915b505050918352505060019190910154602091820152908252600a83015482820152600b9092015460409091015290825260039092015491810191909152915050919050565b60008181526013602052604081206001810154820361144b5750600092915050565b600061145a8260010154610465565b90506004825460ff16600581111561147457611474612a55565b03611483575060049392505050565b600281600481111561149757611497612a55565b036114a6575060059392505050565b60038160048111156114ba576114ba612a55565b036114c9575060029392505050565b60048160048111156114dd576114dd612a55565b036114ec575060039392505050565b505460ff1692915050565b60006106c082611505611be9565b61243f565b6000828152601360209081526040808320600101548084526011909252909120546001600160a01b03166115725760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064016104b9565b6000838152601360209081526040808320600181015484526011835281842082516003808252608082019094529194909390929082016060803683370190505090506115c56115c0876106ad565b612472565b816000815181106115d8576115d8613405565b602090810291909101015260098201546115f190612483565b8160018151811061160457611604613405565b60200260200101818152505082600301548160028151811061162857611628613405565b60200260200101818152505061163f86868361248f565b505050505050565b61164f612994565b60008281526011602052604090205482906001600160a01b03166116a75760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064016104b9565b600083815260116020908152604091829020825160a0808201855282546001600160a01b03168252845160e081018652600184015467ffffffffffffffff90811682526002850154828701526003850154828801526004850154606083015260058501546080830152600685015492820192909252600784015490911660c0820152928101929092528251808401845260088201805493949293928501928290829061175290612e56565b80601f016020809104026020016040519081016040528092919081815260200182805461177e90612e56565b80156117cb5780601f106117a0576101008083540402835291602001916117cb565b820191906000526020600020905b8154815290600101906020018083116117ae57829003601f168201915b505050505081526020016001820154815250508152602001600a8201548152602001600b82015481525050915050919050565b600081831061180d578161180f565b825b9392505050565b60006118218261264d565b90504281106118725760405162461bcd60e51b815260206004820152601860248201527f506572696f6420686173206e6f7420656e64656420796574000000000000000060448201526064016104b9565b60015461187f9082612e0b565b42106118cd5760405162461bcd60e51b815260206004820152601460248201527f56616c69646174696f6e2074696d6564206f757400000000000000000000000060448201526064016104b9565b600083815260086020908152604080832085845290915290205460ff16156119375760405162461bcd60e51b815260206004820181905260248201527f50726f6f6620776173207375626d69747465642c206e6f74206d697373696e6760448201526064016104b9565b611941838361243f565b61198d5760405162461bcd60e51b815260206004820152601660248201527f50726f6f6620776173206e6f742072657175697265640000000000000000000060448201526064016104b9565b600083815260096020908152604080832085845290915290205460ff16156119f75760405162461bcd60e51b815260206004820152601f60248201527f50726f6f6620616c7265616479206d61726b6564206173206d697373696e670060448201526064016104b9565b60008381526009602090815260408083208584528252808320805460ff1916600190811790915586845260079092528220805491929091611a39908490612e0b565b9091555050505050565b60008181526013602090815260408083206001810154808552601290935292206005830154611a7b906001600160a01b0316856122c3565b6003808401546000868152601360205260408120805460ff1916815560018082018390556002820183905593810182905560048101829055600501805473ffffffffffffffffffffffffffffffffffffffff191690558383018054929392909190611ae7908490612da3565b909155505060405181815283907f1d31c9f8dea6e179f6a050db117595feea8937029ea51f5168a4780be7e8f5529060200160405180910390a2600085815260076020526040812055600083815260116020526040812060018085015490820154919291611b5f919067ffffffffffffffff16612da3565b600783015490915067ffffffffffffffff1681118015611b9457506001845460ff166004811115611b9257611b92612a55565b145b15611be057835460ff19166004178455611baf600142612da3565b600485015560405185907f4769361a442504ecaf038f35e119bcccdd5e42096b24c09e3c17fd17c6684c0290600090a25b50505050505050565b60006109ff42612660565b600061180f611c038484611c08565b61268c565b600080611c1761010043612dcc565b90506000610100611c29856043612de0565b611c339190612dcc565b90506000611c4361010087612dcc565b9050600061010082611c558587612e0b565b611c5f9190612e0b565b611c699190612dcc565b979650505050505050565b600082815260116020908152604080832060129092528220600501548310611cde5760405162461bcd60e51b815260206004820152601760248201527f5374617274206e6f74206265666f72652065787069727900000000000000000060448201526064016104b9565b600581015483611cfd8660009081526012602052604090206005015490565b611d079190612da3565b61045d9190612de0565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152306024830181905260448301849052917f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303816000875af1158015611da4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc89190612e1e565b611e145760405162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c6564000000000000000000000000000000000060448201526064016104b9565b505050565b6001600160a01b0382166000908152600b60205260409020611e1490826126e6565b6060600061180f836126f2565b6001600160a01b0382166000908152600a60205260409020611e14908261274e565b60008281526011602052604090205482906001600160a01b0316611ec25760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064016104b9565b60008381526012602090815260408083206011909252909120815460ff191660031782558054611efb906001600160a01b031686611e48565b60008481526013602052604090206005810154611f21906001600160a01b0316866122c3565b6004808201546000888152601160209081526040808320815160a0808201845282546001600160a01b03168252835160e081018552600184015467ffffffffffffffff908116825260028501548288015260038501548287015298840154606082015260058401546080820152600684015491810191909152600783015490971660c08801529283019590955280518082018252600886018054949661207e959093850192919082908290611fd590612e56565b80601f016020809104026020016040519081016040528092919081815260200182805461200190612e56565b801561204e5780601f106120235761010080835404028352916020019161204e565b820191906000526020600020905b81548152906001019060200180831161203157829003601f168201915b505050505081526020016001820154815250508152602001600a8201548152602001600b8201548152505061275a565b6120889190612e0b565b9050806014600101600082825461209f9190612e0b565b9091555050815460ff191660049081178355600583015460405163a9059cbb60e01b81526001600160a01b0391821692810192909252602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015612127573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214b9190612e1e565b611be057611be0612e40565b60008281526011602052604090205482906001600160a01b03166121af5760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064016104b9565b600082815260136020526040902060058101546121d5906001600160a01b0316846122c3565b600081600401546121ea868460020154611c74565b6121f49190612e0b565b9050806014600101600082825461220b9190612e0b565b9091555050815460ff191660049081178355600583015460405163a9059cbb60e01b81526001600160a01b0391821692810192909252602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015612293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b79190612e1e565b6106a5576106a5612e40565b6001600160a01b0382166000908152600b60205260409020611e14908261274e565b60008060006122f385611429565b6000868152600560205260408120549192509061230f90612660565b9050600182600581111561232557612325612a55565b14158061233957506123378582612776565b155b1561234c576000809350935050506123c1565b6123568686611c08565b925060006123638461268c565b6002549091506000906101009061237d9060ff168261341b565b60008a81526006602052604090205461239a9161ffff1690612de0565b6123a49190612df7565b90508015806123ba57506123b88183612dcc565b155b9550505050505b9250929050565b6000816040516020016123db9190612d7a565b604051602081830303815290604052805190602001209050919050565b6001600160a01b0382166000908152600a60205260409020611e1490826126e6565b60006124258261275a565b6020830151516106c0919067ffffffffffffffff16612de0565b600080600061244e85856122e5565b9092509050818015612469575060025460ff90811690821610155b95945050505050565b600060ff1982168161045d82612780565b60008061180f83612780565b6000838152600860205260408120906124a6611be9565b815260208101919091526040016000205460ff16156125075760405162461bcd60e51b815260206004820152601760248201527f50726f6f6620616c7265616479207375626d697474656400000000000000000060448201526064016104b9565b600480546040517f94c8919d0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116916394c8919d91612551918691869101613436565b602060405180830381865afa15801561256e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125929190612e1e565b6125de5760405162461bcd60e51b815260206004820152600d60248201527f496e76616c69642070726f6f660000000000000000000000000000000000000060448201526064016104b9565b60008381526008602052604081206001916125f7611be9565b815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3b989d183b84b02259d7c14b34a9c9eb0fccb4c355a920d25e581e25aef4993d8360405161123391815260200190565b60006106c061265b836127f2565b6127ff565b60006106c07f000000000000000000000000000000000000000000000000000000000000000083612df7565b60008060ff831661269e600143612da3565b6126a89190612da3565b40905060008190036126bc576126bc612e40565b60408051602081018390520160405160208183030381529060405280519060200120915050919050565b600061180f838361282b565b60608160000180548060200260200160405190810160405280929190818152602001828054801561274257602002820191906000526020600020905b81548152602001906001019080831161272e575b50505050509050919050565b600061180f838361287a565b602081015160808101516040909101516000916106c091612de0565b600081831161180f565b7fff00000000000000000000000000000000000000000000000000000000000000811660015b602081101561055157600891821c916127c0908290612de0565b83901b7fff000000000000000000000000000000000000000000000000000000000000001691909117906001016127a6565b60006106c0826001612e0b565b60006106c07f000000000000000000000000000000000000000000000000000000000000000083612de0565b6000818152600183016020526040812054612872575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106c0565b5060006106c0565b6000818152600183016020526040812054801561296357600061289e600183612da3565b85549091506000906128b290600190612da3565b90508181146129175760008660000182815481106128d2576128d2613405565b90600052602060002001549050808760000184815481106128f5576128f5613405565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612928576129286134e1565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106c0565b60009150506106c0565b5092915050565b6040518060400160405280612987612994565b8152602001600081525090565b6040518060a0016040528060006001600160a01b03168152602001612a036040518060e00160405280600067ffffffffffffffff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600067ffffffffffffffff1681525090565b8152602001612a28604051806040016040528060608152602001600080191681525090565b815260006020820181905260409091015290565b600060208284031215612a4e57600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6020810160058310612a7f57612a7f612a55565b91905290565b60008060408385031215612a9857600080fd5b50508035926020909101359150565b6000610100828403121561055157600080fd5b60008060006101408486031215612ad057600080fd5b8335925060208401359150612ae88560408601612aa7565b90509250925092565b6020808252825182820181905260009190848201906040850190845b81811015612b2957835183529284019291840191600101612b0d565b50909695505050505050565b6000815180845260005b81811015612b5b57602081850181015186830182015201612b3f565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000825160ff815116602084015260ff602082015116604084015261ffff604082015116606084015260ff606082015116608084015250602083015160a080840152805160c0840152602081015160e084015260ff60408201511661010084015260608101519050608061012084015261045d610140840182612b35565b600060208284031215612c0f57600080fd5b813567ffffffffffffffff811115612c2657600080fd5b8201610160818503121561180f57600080fd5b6000815160408452612c4e6040850182612b35565b602093840151949093019390935250919050565b60006101606001600160a01b038351168452602083015167ffffffffffffffff808251166020870152602082015160408701526040820151606087015260608201516080870152608082015160a087015260a082015160c08701528060c08301511660e08701525050604083015181610100860152612ce382860182612c39565b915050606083015161012085015260808301516101408501528091505092915050565b602081526000825160406020840152612d226060840182612c62565b9050602084015160408401528091505092915050565b6020810160068310612a7f57612a7f612a55565b6000806101208385031215612d6057600080fd5b82359150612d718460208501612aa7565b90509250929050565b60208152600061180f6020830184612c62565b634e487b7160e01b600052601160045260246000fd5b818103818111156106c0576106c0612d8d565b634e487b7160e01b600052601260045260246000fd5b600082612ddb57612ddb612db6565b500690565b80820281158282048414176106c0576106c0612d8d565b600082612e0657612e06612db6565b500490565b808201808211156106c0576106c0612d8d565b600060208284031215612e3057600080fd5b8151801515811461180f57600080fd5b634e487b7160e01b600052600160045260246000fd5b600181811c90821680612e6a57607f821691505b60208210810361055157634e487b7160e01b600052602260045260246000fd5b6001600160a01b0381168114612e9f57600080fd5b50565b600060208284031215612eb457600080fd5b813561180f81612e8a565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715612ef857612ef8612ebf565b60405290565b60405160a0810167ffffffffffffffff81118282101715612ef857612ef8612ebf565b60405160e0810167ffffffffffffffff81118282101715612ef857612ef8612ebf565b604051601f8201601f1916810167ffffffffffffffff81118282101715612f6d57612f6d612ebf565b604052919050565b67ffffffffffffffff81168114612e9f57600080fd5b600060408284031215612f9d57600080fd5b612fa5612ed5565b9050813567ffffffffffffffff80821115612fbf57600080fd5b818401915084601f830112612fd357600080fd5b8135602082821115612fe757612fe7612ebf565b612ff9601f8301601f19168201612f44565b9250818352868183860101111561300f57600080fd5b8181850182850137600081838501015282855280860135818601525050505092915050565b600081360361016081121561304857600080fd5b613050612efe565b833561305b81612e8a565b815260e0601f198301121561306f57600080fd5b613077612f21565b9150602084013561308781612f75565b8083525060408401356020830152606084013560408301526080840135606083015260a0840135608083015260c084013560a083015260e08401356130cb81612f75565b60c083015260208101919091526101008301359067ffffffffffffffff8211156130f457600080fd5b61310036838601612f8b565b604082015261012084013560608201526101409093013560808401525090919050565b600081356106c081612f75565b60008235603e1983360301811261314657600080fd5b9190910192915050565b601f821115611e14576000816000526020600020601f850160051c810160208610156131795750805b601f850160051c820191505b8181101561163f57828155600101613185565b8135601e198336030181126131ac57600080fd5b8201803567ffffffffffffffff8111156131c557600080fd5b602081360381840113156131d857600080fd5b6131ec826131e68654612e56565b86613150565b6000601f831160018114613222576000841561320a57508482018301355b600019600386901b1c1916600185901b17865561327f565b600086815260209020601f19851690835b82811015613254578785018601358255938501936001909101908501613233565b50858210156132735760001960f88760031b161c198585890101351681555b505060018460011b0186555b50508085013560018501555050505050565b813561329c81612e8a565b6001600160a01b03811673ffffffffffffffffffffffffffffffffffffffff198354161782555060208201356132d181612f75565b60018201805467ffffffffffffffff191667ffffffffffffffff83161790555060408201356002820155606082013560038201556080820135600482015560a0820135600582015560c0820135600682015561335561333260e08401613123565b6007830167ffffffffffffffff821667ffffffffffffffff198254161781555050565b61336f613366610100840184613130565b60088301613198565b610120820135600a820155610140820135600b8201555050565b8381526101208101833561339c81612f75565b67ffffffffffffffff8082166020850152602086013560408501526040860135606085015260608601356080850152608086013560a085015260a086013560c085015260c086013591506133ef82612f75565b1660e08301526101009091019190915292915050565b634e487b7160e01b600052603260045260246000fd5b61ffff82811682821603908082111561296d5761296d612d8d565b82358152602080840135908201526000610120828101613466604085016040880180358252602090810135910152565b613480608085016080880180358252602090810135910152565b61349a60c0850160c0880180358252602090810135910152565b61010084019190915283519081905261014083019060209081860160005b828110156134d4578151855293830193908301906001016134b8565b5092979650505050505050565b634e487b7160e01b600052603160045260246000fdfea264697066735822122018af34de337780d47ca891540a9390f1b4ef028567fed32e08410582d7c9120564736f6c63430008170033"; + public static string BYTECODE = "0x60c06040523480156200001157600080fd5b5060405162004066380380620040668339810160408190526200003491620004f1565b60208301518051608052816101004311620000965760405162461bcd60e51b815260206004820152601960248201527f496e73756666696369656e7420626c6f636b206865696768740000000000000060448201526064015b60405180910390fd5b81516000908155602083015160015560408301516002805460ff191660ff9092169190911790556060830151839190600390620000d4908262000691565b50608091909101516004909101805460ff191660ff928316179055600580546001600160a01b0319166001600160a01b0393841617905590841660a05284515160649116111590506200016a5760405162461bcd60e51b815260206004820152601560248201527f4d757374206265206c657373207468616e20313030000000000000000000000060448201526064016200008d565b606483600001516060015160ff161115620001c85760405162461bcd60e51b815260206004820152601560248201527f4d757374206265206c657373207468616e20313030000000000000000000000060448201526064016200008d565b82516060810151602090910151606491620001e3916200075d565b60ff161115620002365760405162461bcd60e51b815260206004820152601d60248201527f4d6178696d756d20736c617368696e672065786365656473203130302500000060448201526064016200008d565b82518051600d805460208085015160408087015160609788015160ff9081166401000000000260ff60201b1961ffff90931662010000029290921664ffffff0000199482166101000261ffff1990971698821698909817959095179290921695909517178355808801518051600e90815591810151600f5593840151601080549190931660ff19919091161790915592820151869391929190601190620002de908262000691565b50608091909101516004909101805460ff191660ff909216919091179055506200078f9350505050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b038111828210171562000343576200034362000308565b60405290565b604080519081016001600160401b038111828210171562000343576200034362000308565b604051608081016001600160401b038111828210171562000343576200034362000308565b604051601f8201601f191681016001600160401b0381118282101715620003be57620003be62000308565b604052919050565b805160ff81168114620003d857600080fd5b919050565b600060a08284031215620003f057600080fd5b620003fa6200031e565b905081518152602080830151818301526200041860408401620003c6565b604083015260608301516001600160401b03808211156200043857600080fd5b818501915085601f8301126200044d57600080fd5b81518181111562000462576200046262000308565b62000476601f8201601f1916850162000393565b915080825286848285010111156200048d57600080fd5b60005b81811015620004ad57838101850151838201860152840162000490565b50600084828401015250806060850152505050620004ce60808301620003c6565b608082015292915050565b80516001600160a01b0381168114620003d857600080fd5b6000806000606084860312156200050757600080fd5b83516001600160401b03808211156200051f57600080fd5b9085019081870360a08112156200053557600080fd5b6200053f62000349565b60808212156200054e57600080fd5b620005586200036e565b91506200056584620003c6565b82526200057560208501620003c6565b6020830152604084015161ffff811681146200059057600080fd5b6040830152620005a360608501620003c6565b606083015290815260808301519082821115620005bf57600080fd5b620005cd89838601620003dd565b602082015280965050505050620005e760208501620004d9565b9150620005f760408501620004d9565b90509250925092565b600181811c908216806200061557607f821691505b6020821081036200063657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200068c576000816000526020600020601f850160051c81016020861015620006675750805b601f850160051c820191505b81811015620006885782815560010162000673565b5050505b505050565b81516001600160401b03811115620006ad57620006ad62000308565b620006c581620006be845462000600565b846200063c565b602080601f831160018114620006fd5760008415620006e45750858301515b600019600386901b1c1916600185901b17855562000688565b600085815260208120601f198616915b828110156200072e578886015182559484019460019091019084016200070d565b50858210156200074d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60ff81811683821602908116908181146200078857634e487b7160e01b600052601160045260246000fd5b5092915050565b60805160a051613880620007e660003960008181610406015281816115f301528181611fb101528181612050015281816121c501528181612264015261248601526000818161293d0152612ab401526138806000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c80639777b72c116100e3578063c0cc4add1161008c578063f752196b11610066578063f752196b146103c4578063fb1e61ca146103e4578063fc0c546a1461040457600080fd5b8063c0cc4add1461038b578063c5d433511461039e578063e8aa0a07146103b157600080fd5b8063a6af384b116100bd578063a6af384b14610338578063b396dc791461034b578063be5cdc481461036b57600080fd5b80639777b72c146102fa578063a29c29a414610302578063a3a0807e1461031557600080fd5b80634641dce6116101455780636b00c8cf1161011f5780636b00c8cf1461028e5780636e2b54ee146102d257806379502c55146102e557600080fd5b80634641dce61461024157806359cc89ed146102665780635da738351461027957600080fd5b80630aefaabe116101765780630aefaabe146101f8578063329b5a0b1461020b578063458d2bf11461022e57600080fd5b806302fa8e651461019d57806305b90773146101c357806308695fcd146101e3575b600080fd5b6101b06101ab366004612cea565b61042a565b6040519081526020015b60405180910390f35b6101d66101d1366004612cea565b6104a1565b6040516101ba9190612d19565b6101f66101f1366004612d33565b610593565b005b6101f6610206366004612d6a565b6106e9565b6101b0610219366004612cea565b60009081526014602052604090206005015490565b6101b061023c366004612cea565b6108c6565b61025461024f366004612cea565b6108df565b60405160ff90911681526020016101ba565b6101f6610274366004612dbf565b6108f2565b610281610bf6565b6040516101ba9190612df6565b6102ba61029c366004612cea565b6000908152601560205260409020600501546001600160a01b031690565b6040516001600160a01b0390911681526020016101ba565b6101f66102e0366004612cea565b610c1d565b6102ed610c2a565b6040516101ba9190612e80565b610281610db3565b6101f6610310366004612cea565b610dd2565b610328610323366004612cea565b610e42565b60405190151581526020016101ba565b6101f6610346366004612f1b565b610e77565b61035e610359366004612cea565b611163565b6040516101ba9190613024565b61037e610379366004612cea565b61134c565b6040516101ba9190613056565b610328610399366004612cea565b61141a565b6101f66103ac36600461306a565b61142d565b6101f66103bf36600461309a565b61166c565b6101b06103d2366004612cea565b60009081526008602052604090205490565b6103f76103f2366004612cea565b6117a1565b6040516101ba91906130c8565b7f00000000000000000000000000000000000000000000000000000000000000006102ba565b60008181526014602052604081206004015481610446846104a1565b9050600081600481111561045c5761045c612d03565b14806104795750600181600481111561047757610477612d03565b145b15610485575092915050565b610499826104946001426130f1565b611958565b949350505050565b60008181526013602052604081205482906001600160a01b03166104fe5760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064015b60405180910390fd5b600083815260146020526040812090815460ff16600481111561052357610523612d03565b148015610540575060008481526014602052604090206005015442115b1561054f57600292505061058d565b6001815460ff16600481111561056757610567612d03565b1480156105775750806004015442115b1561058657600392505061058d565b5460ff1691505b50919050565b600161059e8361134c565b60058111156105af576105af612d03565b146105fc5760405162461bcd60e51b815260206004820152601960248201527f536c6f74206e6f7420616363657074696e672070726f6f66730000000000000060448201526064016104f5565b6106068282611970565b6000828152601560209081526040808320600181015484526013909252909120600d5461ffff620100009091041661064a8560009081526008602052604090205490565b610654919061311a565b6000036106e357600d54600682015460009160649161067e91640100000000900460ff169061312e565b6106889190613145565b90508083600401600082825461069e91906130f1565b9091555050600d54600086815260086020526040902054610100820460ff169162010000900461ffff16906106d39190613145565b106106e1576106e185611b9d565b505b50505050565b826000808281526015602052604090205460ff16600581111561070e5761070e612d03565b0361074a5760405162461bcd60e51b815260206004820152600c60248201526b536c6f74206973206672656560a01b60448201526064016104f5565b600084815260156020526040902060058101546001600160a01b031633146107b45760405162461bcd60e51b815260206004820152601960248201527f536c6f742066696c6c6564206279206f7468657220686f73740000000000000060448201526064016104f5565b60006107bf8661134c565b905060048160058111156107d5576107d5612d03565b036108225760405162461bcd60e51b815260206004820152600c60248201527f416c72656164792070616964000000000000000000000000000000000000000060448201526064016104f5565b600281600581111561083657610836612d03565b036108505761084b8260010154878787611d43565b6108be565b600581600581111561086457610864612d03565b036108795761084b82600101548787876120d5565b600381600581111561088d5761088d612d03565b0361089c5761084b33876122e7565b60018160058111156108b0576108b0612d03565b036108be576108be86611b9d565b505050505050565b60006108d9826108d461230e565b612319565b92915050565b60006108d9826108ed61230e565b61232d565b60008381526013602052604090205483906001600160a01b031661094a5760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064016104f5565b6000848152601360205260409020600181015467ffffffffffffffff1684106109b55760405162461bcd60e51b815260206004820152600c60248201527f496e76616c696420736c6f74000000000000000000000000000000000000000060448201526064016104f5565b6040805160208082018890528183018790528251808303840181526060909201909252805191012060009060008181526015602052604081206001810189905560038101889055919250610a088361134c565b6005811115610a1957610a19612d03565b14610a665760405162461bcd60e51b815260206004820152601060248201527f536c6f74206973206e6f7420667265650000000000000000000000000000000060448201526064016104f5565b600483015460008381526006602090815260408083204290556007909152902055610a91828661166c565b60058101805473ffffffffffffffffffffffffffffffffffffffff191633179055805460ff191660019081178255426002830155600088815260146020526040812080830180549193929091610ae8908490613159565b90915550610af8905088426123a1565b816002016000828254610b0b91906130f1565b90915550506006840154610b1f338261243e565b8060166000016000828254610b349190613159565b9091555050600483018190556005830154610b58906001600160a01b031685612541565b887ff530852268993f91008f1a1e0b09b5c813acd4188481f1fa83c33c7182e814b489604051610b8a91815260200190565b60405180910390a26001808601549083015467ffffffffffffffff9091169003610beb57815460ff1916600117825542600383015560405189907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a25b505050505050505050565b336000908152600c60205260409020606090610c1890610c1590612563565b90565b905090565b610c27813361142d565b50565b610c886040805160c0810182526000918101828152606082018390526080820183905260a082019290925290819081526040805160a08101825260008082526020828101829052928201819052606080830152608082015291015290565b6040805160c081018252600d805460ff8082168486019081526101008304821660608087019190915261ffff620100008504166080870152640100000000909304821660a08087019190915290855285519081018652600e80548252600f54602083810191909152601054909316968201969096526011805495969495928701949193919291840191610d1a9061316c565b80601f0160208091040260200160405190810160405280929190818152602001828054610d469061316c565b8015610d935780601f10610d6857610100808354040283529160200191610d93565b820191906000526020600020905b815481529060010190602001808311610d7657829003601f168201915b50505091835250506004919091015460ff16602090910152905250919050565b336000908152600b60205260409020606090610c1890610c1590612563565b806000808281526015602052604090205460ff166005811115610df757610df7612d03565b03610e335760405162461bcd60e51b815260206004820152600c60248201526b536c6f74206973206672656560a01b60448201526064016104f5565b610e3e8233336106e9565b5050565b6000806000610e5884610e5361230e565b612570565b9092509050818015610499575060025460ff9081169116109392505050565b33610e8560208301836131a0565b6001600160a01b031614610edb5760405162461bcd60e51b815260206004820152601660248201527f496e76616c696420636c69656e7420616464726573730000000000000000000060448201526064016104f5565b6000610eee610ee983613332565b612653565b6000818152601360205260409020549091506001600160a01b031615610f565760405162461bcd60e51b815260206004820152601660248201527f5265717565737420616c7265616479206578697374730000000000000000000060448201526064016104f5565b6000826101200135118015610f7357506060820135610120830135105b610fbf5760405162461bcd60e51b815260206004820152601360248201527f457870697279206e6f7420696e2072616e67650000000000000000000000000060448201526064016104f5565b610fcf6040830160208401613421565b67ffffffffffffffff16610fea610100840160e08501613421565b67ffffffffffffffff1611156110425760405162461bcd60e51b815260206004820152601960248201527f6d6178536c6f744c6f7373206578636565647320736c6f74730000000000000060448201526064016104f5565b6000818152601360205260409020829061105c82826135ac565b5061106d9050606083013542613159565b60008281526014602052604090206004015561108e61012083013542613159565b6000828152601460209081526040909120600501919091556110bc906110b6908401846131a0565b82612683565b60006110cf6110ca84613332565b6126a5565b60008381526014602052604081206002018290556016805492935083929091906110fa908490613159565b9091555061110a9050338261243e565b7f5fdb86c365a247a4d97dcbcc5c3abde9d6e3e2de26273f3fda8eef5073b9a96c82846020016014600086815260200190815260200160002060050154604051611156939291906136a4565b60405180910390a1505050565b61116b612c22565b816000808281526015602052604090205460ff16600581111561119057611190612d03565b036111cc5760405162461bcd60e51b815260206004820152600c60248201526b536c6f74206973206672656560a01b60448201526064016104f5565b60008381526015602052604090206111e2612c22565b600180830154600090815260136020908152604091829020825160a0808201855282546001600160a01b03168252845160e0810186529583015467ffffffffffffffff9081168752600284015487860152600384015487870152600484015460608801526005840154608088015260068401549187019190915260078301541660c086015291820193909352815180830183526008840180549294938501928290829061128e9061316c565b80601f01602080910402602001604051908101604052809291908181526020018280546112ba9061316c565b80156113075780601f106112dc57610100808354040283529160200191611307565b820191906000526020600020905b8154815290600101906020018083116112ea57829003601f168201915b505050918352505060019190910154602091820152908252600a83015482820152600b9092015460409091015290825260039092015491810191909152915050919050565b60008181526015602052604081206001810154820361136e5750600092915050565b600061137d82600101546104a1565b90506004825460ff16600581111561139757611397612d03565b036113a6575060049392505050565b60028160048111156113ba576113ba612d03565b036113c9575060059392505050565b60038160048111156113dd576113dd612d03565b036113ec575060029392505050565b600481600481111561140057611400612d03565b0361140f575060039392505050565b505460ff1692915050565b60006108d98261142861230e565b6126ca565b600082815260136020908152604080832060149092529091206005015442116114985760405162461bcd60e51b815260206004820152601960248201527f52657175657374206e6f74207965742074696d6564206f75740000000000000060448201526064016104f5565b80546001600160a01b031633146114f15760405162461bcd60e51b815260206004820152601660248201527f496e76616c696420636c69656e7420616464726573730000000000000000000060448201526064016104f5565b600083815260146020526040812090815460ff16600481111561151657611516612d03565b146115635760405162461bcd60e51b815260206004820152600d60248201527f496e76616c69642073746174650000000000000000000000000000000000000060448201526064016104f5565b805460ff191660021781558154611583906001600160a01b0316856126fd565b60405184907ff903f4774c7bd27355f9d7fcbc382b079b164a697a44ac5d95267a4c3cb3bb2290600090a26002810154601780548291906000906115c8908490613159565b909155505060405163a9059cbb60e01b81526001600160a01b038581166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561163c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116609190613720565b6106e1576106e1613742565b6000828152601560209081526040808320600101548084526013909252909120546001600160a01b03166116d45760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064016104f5565b600083815260156020908152604080832060018101548452601383528184208251600380825260808201909452919490939092908201606080368337019050509050611727611722876108c6565b61271f565b8160008151811061173a5761173a613758565b6020908102919091010152600982015461175390612730565b8160018151811061176657611766613758565b60200260200101818152505082600301548160028151811061178a5761178a613758565b6020026020010181815250506108be86868361273c565b6117a9612c42565b60008281526013602052604090205482906001600160a01b03166118015760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064016104f5565b600083815260136020908152604091829020825160a0808201855282546001600160a01b03168252845160e081018652600184015467ffffffffffffffff90811682526002850154828701526003850154828801526004850154606083015260058501546080830152600685015492820192909252600784015490911660c082015292810192909252825180840184526008820180549394929392850192829082906118ac9061316c565b80601f01602080910402602001604051908101604052809291908181526020018280546118d89061316c565b80156119255780601f106118fa57610100808354040283529160200191611925565b820191906000526020600020905b81548152906001019060200180831161190857829003601f168201915b505050505081526020016001820154815250508152602001600a8201548152602001600b82015481525050915050919050565b60008183106119675781611969565b825b9392505050565b600061197b826128fb565b90504281106119cc5760405162461bcd60e51b815260206004820152601860248201527f506572696f6420686173206e6f7420656e64656420796574000000000000000060448201526064016104f5565b6001546119d99082613159565b4210611a275760405162461bcd60e51b815260206004820152601460248201527f56616c69646174696f6e2074696d6564206f757400000000000000000000000060448201526064016104f5565b600083815260096020908152604080832085845290915290205460ff1615611a915760405162461bcd60e51b815260206004820181905260248201527f50726f6f6620776173207375626d69747465642c206e6f74206d697373696e6760448201526064016104f5565b611a9b83836126ca565b611ae75760405162461bcd60e51b815260206004820152601660248201527f50726f6f6620776173206e6f742072657175697265640000000000000000000060448201526064016104f5565b6000838152600a6020908152604080832085845290915290205460ff1615611b515760405162461bcd60e51b815260206004820152601f60248201527f50726f6f6620616c7265616479206d61726b6564206173206d697373696e670060448201526064016104f5565b6000838152600a602090815260408083208584528252808320805460ff1916600190811790915586845260089092528220805491929091611b93908490613159565b9091555050505050565b60008181526015602090815260408083206001810154808552601490935292206005830154611bd5906001600160a01b0316856122e7565b6003808401546000868152601560205260408120805460ff1916815560018082018390556002820183905593810182905560048101829055600501805473ffffffffffffffffffffffffffffffffffffffff191690558383018054929392909190611c419084906130f1565b909155505060405181815283907f1d31c9f8dea6e179f6a050db117595feea8937029ea51f5168a4780be7e8f5529060200160405180910390a2600085815260086020526040812055600083815260136020526040812060018085015490820154919291611cb9919067ffffffffffffffff166130f1565b600783015490915067ffffffffffffffff1681118015611cee57506001845460ff166004811115611cec57611cec612d03565b145b15611d3a57835460ff19166004178455611d096001426130f1565b600485015560405185907f4769361a442504ecaf038f35e119bcccdd5e42096b24c09e3c17fd17c6684c0290600090a25b50505050505050565b60008481526013602052604090205484906001600160a01b0316611d9b5760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064016104f5565b60008581526014602090815260408083206013909252909120815460ff191660031782558054611dd4906001600160a01b0316886126fd565b60008681526015602052604090206005810154611dfa906001600160a01b0316886122e7565b6000888152601360209081526040808320815160a0808201845282546001600160a01b03168252835160e081018552600184015467ffffffffffffffff90811682526002850154828801526003850154828701526004850154606083015260058501546080830152600685015492820192909252600784015490911660c08201529381019390935281518083018352600882018054611f4f9594850192919082908290611ea69061316c565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed29061316c565b8015611f1f5780601f10611ef457610100808354040283529160200191611f1f565b820191906000526020600020905b815481529060010190602001808311611f0257829003601f168201915b505050505081526020016001820154815250508152602001600a8201548152602001600b8201548152505061290e565b6004830154909150611f618183613159565b60178054600090611f73908490613159565b90915550508254600490849060ff1916600183021790555060405163a9059cbb60e01b81526001600160a01b038981166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611ffa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201e9190613720565b61202a5761202a613742565b60405163a9059cbb60e01b81526001600160a01b038881166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015612099573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120bd9190613720565b6120c9576120c9613742565b50505050505050505050565b60008481526013602052604090205484906001600160a01b031661212d5760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064016104f5565b60008481526015602052604090206005810154612153906001600160a01b0316866122e7565b60006121638783600201546123a1565b60048301549091506121758183613159565b60178054600090612187908490613159565b90915550508254600490849060ff1916600183021790555060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561220e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122329190613720565b61223e5761223e613742565b60405163a9059cbb60e01b81526001600160a01b038681166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156122ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d19190613720565b6122dd576122dd613742565b5050505050505050565b6001600160a01b0382166000908152600c60205260409020612309908261292a565b505050565b6000610c1842612936565b6000611969612328848461232d565b612962565b60008061233c6101004361311a565b600454909150600090610100906123569060ff168661312e565b612360919061311a565b905060006123706101008761311a565b90506000610100826123828587613159565b61238c9190613159565b612396919061311a565b979650505050505050565b60008281526013602090815260408083206014909252822060050154831061240b5760405162461bcd60e51b815260206004820152601760248201527f5374617274206e6f74206265666f72652065787069727900000000000000000060448201526064016104f5565b60058101548361242a8660009081526014602052604090206005015490565b61243491906130f1565b610499919061312e565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152306024830181905260448301849052917f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303816000875af11580156124d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f59190613720565b6123095760405162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c6564000000000000000000000000000000000060448201526064016104f5565b6001600160a01b0382166000908152600c6020526040902061230990826129bc565b60606000611969836129c8565b600080600061257e8561134c565b6000868152600660205260408120549192509061259a90612936565b905060018260058111156125b0576125b0612d03565b1415806125c457506125c28582612a24565b155b156125d75760008093509350505061264c565b6125e1868661232d565b925060006125ee84612962565b600254909150600090610100906126089060ff168261376e565b60008a8152600760205260409020546126259161ffff169061312e565b61262f9190613145565b90508015806126455750612643818361311a565b155b9550505050505b9250929050565b60008160405160200161266691906130c8565b604051602081830303815290604052805190602001209050919050565b6001600160a01b0382166000908152600b6020526040902061230990826129bc565b60006126b08261290e565b6020830151516108d9919067ffffffffffffffff1661312e565b60008060006126d98585612570565b90925090508180156126f4575060025460ff90811690821610155b95945050505050565b6001600160a01b0382166000908152600b60205260409020612309908261292a565b600060ff1982168161049982612a2e565b60008061196983612a2e565b60008381526009602052604081209061275361230e565b815260208101919091526040016000205460ff16156127b45760405162461bcd60e51b815260206004820152601760248201527f50726f6f6620616c7265616479207375626d697474656400000000000000000060448201526064016104f5565b6005546040517f94c8919d0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116906394c8919d906127ff9085908590600401613789565b602060405180830381865afa15801561281c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128409190613720565b61288c5760405162461bcd60e51b815260206004820152600d60248201527f496e76616c69642070726f6f660000000000000000000000000000000000000060448201526064016104f5565b60008381526009602052604081206001916128a561230e565b815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3b989d183b84b02259d7c14b34a9c9eb0fccb4c355a920d25e581e25aef4993d8360405161115691815260200190565b60006108d961290983612aa0565b612aad565b602081015160808101516040909101516000916108d99161312e565b60006119698383612ad9565b60006108d97f000000000000000000000000000000000000000000000000000000000000000083613145565b60008060ff83166129746001436130f1565b61297e91906130f1565b409050600081900361299257612992613742565b60408051602081018390520160405160208183030381529060405280519060200120915050919050565b60006119698383612bd3565b606081600001805480602002602001604051908101604052809291908181526020018280548015612a1857602002820191906000526020600020905b815481526020019060010190808311612a04575b50505050509050919050565b6000818311611969565b7fff00000000000000000000000000000000000000000000000000000000000000811660015b602081101561058d57600891821c91612a6e90829061312e565b83901b7fff00000000000000000000000000000000000000000000000000000000000000169190911790600101612a54565b60006108d9826001613159565b60006108d97f00000000000000000000000000000000000000000000000000000000000000008361312e565b60008181526001830160205260408120548015612bc2576000612afd6001836130f1565b8554909150600090612b11906001906130f1565b9050818114612b76576000866000018281548110612b3157612b31613758565b9060005260206000200154905080876000018481548110612b5457612b54613758565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612b8757612b87613834565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108d9565b60009150506108d9565b5092915050565b6000818152600183016020526040812054612c1a575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108d9565b5060006108d9565b6040518060400160405280612c35612c42565b8152602001600081525090565b6040518060a0016040528060006001600160a01b03168152602001612cb16040518060e00160405280600067ffffffffffffffff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600067ffffffffffffffff1681525090565b8152602001612cd6604051806040016040528060608152602001600080191681525090565b815260006020820181905260409091015290565b600060208284031215612cfc57600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6020810160058310612d2d57612d2d612d03565b91905290565b60008060408385031215612d4657600080fd5b50508035926020909101359150565b6001600160a01b0381168114610c2757600080fd5b600080600060608486031215612d7f57600080fd5b833592506020840135612d9181612d55565b91506040840135612da181612d55565b809150509250925092565b6000610100828403121561058d57600080fd5b60008060006101408486031215612dd557600080fd5b8335925060208401359150612ded8560408601612dac565b90509250925092565b6020808252825182820181905260009190848201906040850190845b81811015612e2e57835183529284019291840191600101612e12565b50909695505050505050565b6000815180845260005b81811015612e6057602081850181015186830182015201612e44565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000825160ff815116602084015260ff602082015116604084015261ffff604082015116606084015260ff606082015116608084015250602083015160a080840152805160c0840152602081015160e084015260ff604082015116610100840152606081015160a0610120850152612f00610160850182612e3a565b905060ff608083015116610140850152809250505092915050565b600060208284031215612f2d57600080fd5b813567ffffffffffffffff811115612f4457600080fd5b8201610160818503121561196957600080fd5b6000815160408452612f6c6040850182612e3a565b602093840151949093019390935250919050565b60006101606001600160a01b038351168452602083015167ffffffffffffffff808251166020870152602082015160408701526040820151606087015260608201516080870152608082015160a087015260a082015160c08701528060c08301511660e0870152505060408301518161010086015261300182860182612f57565b915050606083015161012085015260808301516101408501528091505092915050565b6020815260008251604060208401526130406060840182612f80565b9050602084015160408401528091505092915050565b6020810160068310612d2d57612d2d612d03565b6000806040838503121561307d57600080fd5b82359150602083013561308f81612d55565b809150509250929050565b60008061012083850312156130ae57600080fd5b823591506130bf8460208501612dac565b90509250929050565b6020815260006119696020830184612f80565b634e487b7160e01b600052601160045260246000fd5b818103818111156108d9576108d96130db565b634e487b7160e01b600052601260045260246000fd5b60008261312957613129613104565b500690565b80820281158282048414176108d9576108d96130db565b60008261315457613154613104565b500490565b808201808211156108d9576108d96130db565b600181811c9082168061318057607f821691505b60208210810361058d57634e487b7160e01b600052602260045260246000fd5b6000602082840312156131b257600080fd5b813561196981612d55565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156131f6576131f66131bd565b60405290565b60405160a0810167ffffffffffffffff811182821017156131f6576131f66131bd565b60405160e0810167ffffffffffffffff811182821017156131f6576131f66131bd565b604051601f8201601f1916810167ffffffffffffffff8111828210171561326b5761326b6131bd565b604052919050565b67ffffffffffffffff81168114610c2757600080fd5b60006040828403121561329b57600080fd5b6132a36131d3565b9050813567ffffffffffffffff808211156132bd57600080fd5b818401915084601f8301126132d157600080fd5b81356020828211156132e5576132e56131bd565b6132f7601f8301601f19168201613242565b9250818352868183860101111561330d57600080fd5b8181850182850137600081838501015282855280860135818601525050505092915050565b600081360361016081121561334657600080fd5b61334e6131fc565b833561335981612d55565b815260e0601f198301121561336d57600080fd5b61337561321f565b9150602084013561338581613273565b8083525060408401356020830152606084013560408301526080840135606083015260a0840135608083015260c084013560a083015260e08401356133c981613273565b60c083015260208101919091526101008301359067ffffffffffffffff8211156133f257600080fd5b6133fe36838601613289565b604082015261012084013560608201526101409093013560808401525090919050565b60006020828403121561343357600080fd5b813561196981613273565b600081356108d981613273565b60008235603e1983360301811261346157600080fd5b9190910192915050565b601f821115612309576000816000526020600020601f850160051c810160208610156134945750805b601f850160051c820191505b818110156108be578281556001016134a0565b8135601e198336030181126134c757600080fd5b8201803567ffffffffffffffff8111156134e057600080fd5b602081360381840113156134f357600080fd5b61350782613501865461316c565b8661346b565b6000601f83116001811461353d576000841561352557508482018301355b600019600386901b1c1916600185901b17865561359a565b600086815260209020601f19851690835b8281101561356f57878501860135825593850193600190910190850161354e565b508582101561358e5760001960f88760031b161c198585890101351681555b505060018460011b0186555b50508085013560018501555050505050565b81356135b781612d55565b6001600160a01b03811673ffffffffffffffffffffffffffffffffffffffff198354161782555060208201356135ec81613273565b60018201805467ffffffffffffffff191667ffffffffffffffff83161790555060408201356002820155606082013560038201556080820135600482015560a0820135600582015560c0820135600682015561367061364d60e0840161343e565b6007830167ffffffffffffffff821667ffffffffffffffff198254161781555050565b61368a61368161010084018461344b565b600883016134b3565b610120820135600a820155610140820135600b8201555050565b838152610120810183356136b781613273565b67ffffffffffffffff8082166020850152602086013560408501526040860135606085015260608601356080850152608086013560a085015260a086013560c085015260c0860135915061370a82613273565b1660e08301526101009091019190915292915050565b60006020828403121561373257600080fd5b8151801515811461196957600080fd5b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b61ffff828116828216039080821115612bcc57612bcc6130db565b823581526020808401359082015260006101208281016137b9604085016040880180358252602090810135910152565b6137d3608085016080880180358252602090810135910152565b6137ed60c0850160c0880180358252602090810135910152565b61010084019190915283519081905261014083019060209081860160005b828110156138275781518552938301939083019060010161380b565b5092979650505050505050565b634e487b7160e01b600052603160045260246000fdfea26469706673582212205af54bf6a34b60413a198c7280788aa6881debbea4523d324111e26100ba9cff64736f6c63430008170033"; public MarketplaceDeploymentBase() : base(BYTECODE) { } public MarketplaceDeploymentBase(string byteCode) : base(byteCode) { } [Parameter("tuple", "configuration", 1)] @@ -47,6 +47,19 @@ namespace CodexContractsPlugin.Marketplace public virtual Groth16Proof Proof { get; set; } } + public partial class FreeSlot1Function : FreeSlot1FunctionBase { } + + [Function("freeSlot")] + public class FreeSlot1FunctionBase : FunctionMessage + { + [Parameter("bytes32", "slotId", 1)] + public virtual byte[] SlotId { get; set; } + [Parameter("address", "rewardRecipient", 2)] + public virtual string RewardRecipient { get; set; } + [Parameter("address", "collateralRecipient", 3)] + public virtual string CollateralRecipient { get; set; } + } + public partial class FreeSlotFunction : FreeSlotFunctionBase { } [Function("freeSlot")] @@ -228,6 +241,17 @@ namespace CodexContractsPlugin.Marketplace public virtual byte[] RequestId { get; set; } } + public partial class WithdrawFunds1Function : WithdrawFunds1FunctionBase { } + + [Function("withdrawFunds")] + public class WithdrawFunds1FunctionBase : FunctionMessage + { + [Parameter("bytes32", "requestId", 1)] + public virtual byte[] RequestId { get; set; } + [Parameter("address", "withdrawRecipient", 2)] + public virtual string WithdrawRecipient { get; set; } + } + public partial class ProofSubmittedEventDTO : ProofSubmittedEventDTOBase { } [Event("ProofSubmitted")] @@ -312,6 +336,8 @@ namespace CodexContractsPlugin.Marketplace + + public partial class GetActiveSlotOutputDTO : GetActiveSlotOutputDTOBase { } [FunctionOutput] @@ -455,6 +481,8 @@ namespace CodexContractsPlugin.Marketplace + + public partial class CollateralConfig : CollateralConfigBase { } public class CollateralConfigBase @@ -481,6 +509,8 @@ namespace CodexContractsPlugin.Marketplace public virtual byte Downtime { get; set; } [Parameter("string", "zkeyHash", 4)] public virtual string ZkeyHash { get; set; } + [Parameter("uint8", "downtimeProduct", 5)] + public virtual byte DowntimeProduct { get; set; } } public partial class MarketplaceConfig : MarketplaceConfigBase { } diff --git a/Tests/CodexTests/BasicTests/MarketplaceTests.cs b/Tests/CodexTests/BasicTests/MarketplaceTests.cs index d429c30..e4d51b1 100644 --- a/Tests/CodexTests/BasicTests/MarketplaceTests.cs +++ b/Tests/CodexTests/BasicTests/MarketplaceTests.cs @@ -14,15 +14,17 @@ namespace CodexTests.BasicTests [Test] [Combinatorial] public void MarketplaceExample( - [Values(4, 8, 16 /* 1mb */, 32)] int numBlocks, - [Values(-3, -2, -1, 0, 1, 2, 3)] int plusSizeKb + [Values(64)] int numBlocks, + [Values(0)] int plusSizeKb, + [Values(0)] int plusSizeBytes ) { var hostInitialBalance = 234.TstWei(); var clientInitialBalance = 100000.TstWei(); var fileSize = new ByteSize( numBlocks * (64 * 1024) + - plusSizeKb * 1024 + plusSizeKb * 1024 + + plusSizeBytes ); var geth = Ci.StartGethNode(s => s.IsMiner().WithName("disttest-geth"));