diff --git a/indy-besu/network/config/besu/genesis.json b/indy-besu/network/config/besu/genesis.json index df139c11b..ec43c804a 100644 --- a/indy-besu/network/config/besu/genesis.json +++ b/indy-besu/network/config/besu/genesis.json @@ -156,7 +156,7 @@ "0x0000000000000000000000000000000000002222": { "comment": "Library to validate DID", "balance": "0", - "code": "0x73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063af8b5bbf1461003a575b600080fd5b61004d610048366004610aac565b61004f565b005b600061005a826100d8565b90506100698160000151610223565b6100915781604051631859e3bb60e11b81526004016100889190610b5d565b60405180910390fd5b600061009f82602001515190565b9050806015141580156100b3575080601614155b156100d35782604051631859e3bb60e11b81526004016100889190610b5d565b505050565b604080518082019091526060808252602082015260006100f7836102c3565b9050600061011d604051806040016040528060018152602001601d60f91b8152506102c3565b905060008061012c84846102d4565b95509250905080158061016a575061016861016160405180604001604052806003815260200162191a5960ea1b8152506102c3565b8390610322565b155b1561018a5785604051631859e3bb60e11b81526004016100889190610b5d565b61019484846102d4565b955092509050806101ba5785604051631859e3bb60e11b81526004016100889190610b5d565b60408051808201909152606080825260208201526101d78361032e565b81526040805180820190915260018152601d60f91b6020820152610205906101fe906102c3565b8690610339565b9450610214915084905061032e565b60208201529695505050505050565b60008061022f836102c3565b905061026061025960405180604001604052806004815260200163696e647960e01b8152506102c3565b8290610322565b8061028f575061028f6102596040518060400160405280600581526020016434b7323c9960d91b8152506102c3565b806102bc57506102bc6102596040518060400160405280600381526020016239b7bb60e91b8152506102c3565b9392505050565b60006102ce82610363565b92915050565b60008080806102e38686610377565b905060001981036102ff5760008660009350935093505061031b565b61031386826001600160801b038816610482565b935093509350505b9250925092565b60006102bc83836104ef565b60606102ce82610539565b600080808061034886866105b1565b905060001981036102ff57600080879350935093505061031b565b6000806020830190506102bc8184516106a3565b60006001600160801b03838116908316808303610399576000925050506102ce565b8115806103a557508181115b156103b657600019925050506102ce565b60006103c28660801c90565b905060006103d08660801c90565b905060006103df825160001a90565b90505b60006103ef8487846106af565b9050600019810361040a5760001996505050505050506102ce565b9485900394928301928585111561042b5760001996505050505050506102ce565b84832085852003610457576104408960801c90565b61044a9085610bac565b96505050505050506102ce565b8560010361046f5760001996505050505050506102ce565b60001990950194600190930192506103e2565b6000806000806104928760801c90565b90506001600160801b038716858701818111156104c2576040516365f4e9df60e01b815260040160405180910390fd5b6001996001600160801b03988916608085811b919091179a50928290039098169201901b17949350505050565b60006001600160801b03838116908316811461050f5760009150506102ce565b61053161051c8560801c90565b6105268560801c90565b839081902091201490565b949350505050565b60606001600160801b03821667ffffffffffffffff81111561055d5761055d610a96565b6040519080825280601f01601f191660200182016040528015610587576020820181803683370190505b509050602081016105ab8161059c8560801c90565b6001600160801b038616610777565b50919050565b60006001600160801b038381169083168083036105d3576000925050506102ce565b8115806105df57508181115b156105f057600019925050506102ce565b60006105fc8660801c90565b9050600061060a8660801c90565b9050600061061787610785565b905060001984015b600061062c8588856107ca565b90506000198103610648576000199750505050505050506102ce565b80821115610661576000199750505050505050506102ce565b8584208282038681018890209091036106835797506102ce9650505050505050565b81156106915750955061061f565b600019985050505050505050506102ce565b60006102bc838361087e565b6000602083116106cb576106c484848461088a565b90506102bc565b83601f8416808503820160ff8516600080516020610bce833981519152025b8188101561072c57875181186106ff8161099c565b15610720578489036107138a60208a61088a565b01955050505050506102bc565b602089019850506106ea565b82600003610742576000199450505050506102bc565b61074d82848861088a565b94506000198503610766576000199450505050506102bc565b509190910391909101949350505050565b8083828460045afa50505050565b60006001600160801b0382168082036107b1576040516365f4e9df60e01b815260040160405180910390fd5b6102bc600182036107c28560801c90565b015160001a90565b6000602083116107df576106c48484846109e7565b601f831684840181156108175781900360006107fc8284876109e7565b9050600019811461081557908690030191506102bc9050565b505b60ff8416600080516020610bce833981519152025b8682111561087057601f199091018051909190811861084a8161099c565b1561086a5787830361085e846020896109e7565b019450505050506102bc565b5061082c565b506000199695505050505050565b60006102bc8383610a30565b825160009081602085111561089e57602094505b601285106109295760ff8416600080516020610bce8339815191520282186108ce6001600160801b03821761099c565b6000036109055760109150601a8610610900576108f467ffffffffffffffff821761099c565b60000361090057601891505b610923565b6109176001600160c01b03821761099c565b60000361092357600891505b50610967565b600a85106109675760ff8416600080516020610bce8339815191520282186109596001600160c01b03821761099c565b60000361096557600891505b505b8481101561098f5781811a60ff85168103610986575091506102bc9050565b50600101610967565b5060001995945050505050565b7ffefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefeff81019019167f80808080808080808080808080808080808080808080808080808080808080801690565b600060208311156109f757602092505b83515b8315610a24576000199093019280841a60ff84168103610a1e5784925050506102bc565b506109fa565b50600019949350505050565b60006001600160801b03831115610a5a5760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b03821115610a8257604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b634e487b7160e01b600052604160045260246000fd5b600060208284031215610abe57600080fd5b813567ffffffffffffffff80821115610ad657600080fd5b818401915084601f830112610aea57600080fd5b813581811115610afc57610afc610a96565b604051601f8201601f19908116603f01168101908382118183101715610b2457610b24610a96565b81604052828152876020848701011115610b3d57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020808352835180602085015260005b81811015610b8b57858101830151858201604001528201610b6f565b506000604082860101526040601f19601f8301168501019250505092915050565b818103818111156102ce57634e487b7160e01b600052601160045260246000fdfe0101010101010101010101010101010101010101010101010101010101010101a26469706673582212201a29e89d4026d9e0506d47d73a66e9b716658f0b17d2677237d5ed6dc886170a64736f6c63430008170033", + "code": "0x73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063af8b5bbf1461003a575b600080fd5b61004d610048366004610aac565b61004f565b005b600061005a826100d8565b90506100698160000151610223565b6100915781604051631859e3bb60e11b81526004016100889190610b5d565b60405180910390fd5b600061009f82602001515190565b9050806015141580156100b3575080601614155b156100d35782604051631859e3bb60e11b81526004016100889190610b5d565b505050565b604080518082019091526060808252602082015260006100f7836102c3565b9050600061011d604051806040016040528060018152602001601d60f91b8152506102c3565b905060008061012c84846102d4565b95509250905080158061016a575061016861016160405180604001604052806003815260200162191a5960ea1b8152506102c3565b8390610322565b155b1561018a5785604051631859e3bb60e11b81526004016100889190610b5d565b61019484846102d4565b955092509050806101ba5785604051631859e3bb60e11b81526004016100889190610b5d565b60408051808201909152606080825260208201526101d78361032e565b81526040805180820190915260018152601d60f91b6020820152610205906101fe906102c3565b8690610339565b9450610214915084905061032e565b60208201529695505050505050565b60008061022f836102c3565b905061026061025960405180604001604052806004815260200163696e647960e01b8152506102c3565b8290610322565b8061028f575061028f6102596040518060400160405280600581526020016434b7323c9960d91b8152506102c3565b806102bc57506102bc6102596040518060400160405280600381526020016239b7bb60e91b8152506102c3565b9392505050565b60006102ce82610363565b92915050565b60008080806102e38686610377565b905060001981036102ff5760008660009350935093505061031b565b61031386826001600160801b038816610482565b935093509350505b9250925092565b60006102bc83836104ef565b60606102ce82610539565b600080808061034886866105b1565b905060001981036102ff57600080879350935093505061031b565b6000806020830190506102bc8184516106a3565b60006001600160801b03838116908316808303610399576000925050506102ce565b8115806103a557508181115b156103b657600019925050506102ce565b60006103c28660801c90565b905060006103d08660801c90565b905060006103df825160001a90565b90505b60006103ef8487846106af565b9050600019810361040a5760001996505050505050506102ce565b9485900394928301928585111561042b5760001996505050505050506102ce565b84832085852003610457576104408960801c90565b61044a9085610bac565b96505050505050506102ce565b8560010361046f5760001996505050505050506102ce565b60001990950194600190930192506103e2565b6000806000806104928760801c90565b90506001600160801b038716858701818111156104c2576040516365f4e9df60e01b815260040160405180910390fd5b6001996001600160801b03988916608085811b919091179a50928290039098169201901b17949350505050565b60006001600160801b03838116908316811461050f5760009150506102ce565b61053161051c8560801c90565b6105268560801c90565b839081902091201490565b949350505050565b60606001600160801b03821667ffffffffffffffff81111561055d5761055d610a96565b6040519080825280601f01601f191660200182016040528015610587576020820181803683370190505b509050602081016105ab8161059c8560801c90565b6001600160801b038616610777565b50919050565b60006001600160801b038381169083168083036105d3576000925050506102ce565b8115806105df57508181115b156105f057600019925050506102ce565b60006105fc8660801c90565b9050600061060a8660801c90565b9050600061061787610785565b905060001984015b600061062c8588856107ca565b90506000198103610648576000199750505050505050506102ce565b80821115610661576000199750505050505050506102ce565b8584208282038681018890209091036106835797506102ce9650505050505050565b81156106915750955061061f565b600019985050505050505050506102ce565b60006102bc838361087e565b6000602083116106cb576106c484848461088a565b90506102bc565b83601f8416808503820160ff8516600080516020610bce833981519152025b8188101561072c57875181186106ff8161099c565b15610720578489036107138a60208a61088a565b01955050505050506102bc565b602089019850506106ea565b82600003610742576000199450505050506102bc565b61074d82848861088a565b94506000198503610766576000199450505050506102bc565b509190910391909101949350505050565b8083828460045afa50505050565b60006001600160801b0382168082036107b1576040516365f4e9df60e01b815260040160405180910390fd5b6102bc600182036107c28560801c90565b015160001a90565b6000602083116107df576106c48484846109e7565b601f831684840181156108175781900360006107fc8284876109e7565b9050600019811461081557908690030191506102bc9050565b505b60ff8416600080516020610bce833981519152025b8682111561087057601f199091018051909190811861084a8161099c565b1561086a5787830361085e846020896109e7565b019450505050506102bc565b5061082c565b506000199695505050505050565b60006102bc8383610a30565b825160009081602085111561089e57602094505b601285106109295760ff8416600080516020610bce8339815191520282186108ce6001600160801b03821761099c565b6000036109055760109150601a8610610900576108f467ffffffffffffffff821761099c565b60000361090057601891505b610923565b6109176001600160c01b03821761099c565b60000361092357600891505b50610967565b600a85106109675760ff8416600080516020610bce8339815191520282186109596001600160c01b03821761099c565b60000361096557600891505b505b8481101561098f5781811a60ff85168103610986575091506102bc9050565b50600101610967565b5060001995945050505050565b7ffefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefeff81019019167f80808080808080808080808080808080808080808080808080808080808080801690565b600060208311156109f757602092505b83515b8315610a24576000199093019280841a60ff84168103610a1e5784925050506102bc565b506109fa565b50600019949350505050565b60006001600160801b03831115610a5a5760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b03821115610a8257604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b634e487b7160e01b600052604160045260246000fd5b600060208284031215610abe57600080fd5b813567ffffffffffffffff80821115610ad657600080fd5b818401915084601f830112610aea57600080fd5b813581811115610afc57610afc610a96565b604051601f8201601f19908116603f01168101908382118183101715610b2457610b24610a96565b81604052828152876020848701011115610b3d57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020808352835180602085015260005b81811015610b8b57858101830151858201604001528201610b6f565b506000604082860101526040601f19601f8301168501019250505092915050565b818103818111156102ce57634e487b7160e01b600052601160045260246000fdfe0101010101010101010101010101010101010101010101010101010101010101a26469706673582212200556d00322535a6ba274045c929465d0f1ca96835484e5f487c7b26ecf90876d64736f6c63430008170033", "storage": {} }, "0x0000000000000000000000000000000000003333": { @@ -166,13 +166,13 @@ "storage": { "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000000108244ebb041d5108d13692c712b66adc8491e3" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000009f6fdc2cb71069949ee53b0b81d1b5ceefd7b57c" } }, - "0x0108244ebb041d5108d13692c712b66adc8491e3": { + "0x9f6fdc2cb71069949ee53b0b81d1b5ceefd7b57c": { "comment": "Implementation: Smart contract to manage DIDs", "balance": "0", - "code": "0x60806040526004361061007b5760003560e01c8063ad3cb1cc1161004e578063ad3cb1cc1461010e578063c4d66de81461014c578063dafffa7d1461016c578063f4653a1d1461018c57600080fd5b80631e715511146100805780633633852c146100a25780634f1ef286146100d857806352d1902d146100eb575b600080fd5b34801561008c57600080fd5b506100a061009b366004611045565b6101ac565b005b3480156100ae57600080fd5b506100c26100bd3660046110c6565b6103e2565b6040516100cf9190611158565b60405180910390f35b6100a06100e63660046111d9565b61057d565b3480156100f757600080fd5b5061010061059c565b6040519081526020016100cf565b34801561011a57600080fd5b5061013f604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100cf919061129b565b34801561015857600080fd5b506100a06101673660046112ae565b6105b9565b34801561017857600080fd5b506100a06101873660046112c9565b61069e565b34801561019857600080fd5b506100a06101a73660046110c6565b6108f1565b83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506101f391508390611335565b908152604051908190036020019020600301541561022f5780604051630eb7cd9560e01b8152600401610226919061129b565b60405180910390fd5b60405163af8b5bbf60e01b81527300000000000000000000000000000000000022229063af8b5bbf90610268908890889060040161137a565b60006040518083038186803b15801561028057600080fd5b505af4158015610294573d6000803e3d6000fd5b505050508282600187876040516102ac929190611396565b908152604051908190036020019020916102c7919083611430565b5085600186866040516102db929190611396565b908152604051908190036020018120600190810180546001600160a01b03949094166001600160a01b0319909416939093179092553391906103209088908890611396565b90815260405190819003602001812060020180546001600160a01b03939093166001600160a01b03199093169290921790915542906001906103659088908890611396565b90815260405190819003602001812060030191909155429060019061038d9088908890611396565b908152604051908190036020018120600401919091557f5fccafd09eeeb6a3dc1c80357ee982c00d7fb00a991274a9b96fe4fd7cb60552906103d2908790879061137a565b60405180910390a1505050505050565b6103ea610f83565b82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516001925061043191508390611335565b90815260405190819003602001902060030154600003610466578060405163186a887560e11b8152600401610226919061129b565b60018484604051610478929190611396565b90815260200160405180910390206040518060400160405290816000820180546104a1906113a6565b80601f01602080910402602001604051908101604052809291908181526020018280546104cd906113a6565b801561051a5780601f106104ef5761010080835404028352916020019161051a565b820191906000526020600020905b8154815290600101906020018083116104fd57829003601f168201915b50505091835250506040805160a08101825260018401546001600160a01b0390811682526002850154166020808301919091526003850154928201929092526004840154606082015260059093015460ff16151560808401520152949350505050565b610585610b20565b61058e82610bc7565b6105988282610c2d565b5050565b60006105a6610cef565b5060008051602061150a83398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806106035750805467ffffffffffffffff808416911610155b156106215760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b17815561064c83610d38565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506106e591508390611335565b9081526040519081900360200190206003015460000361071a578060405163186a887560e11b8152600401610226919061129b565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516001925061076191508390611335565b9081526040519081900360200190206005015460ff16156107975780604051630341716360e51b8152600401610226919061129b565b85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506107de91508390611335565b90815260405190819003602001902060010154336001600160a01b039091161480159061083857506001816040516108169190611335565b90815260405190819003602001902060020154336001600160a01b0390911614155b1561085857604051633fcc3f1760e01b8152336004820152602401610226565b84846001898960405161086c929190611396565b90815260405190819003602001902091610887919083611430565b50426001888860405161089b929190611396565b908152604051908190036020018120600401919091557f7e7500a71b0209575a3b4858a2a662e94b0cad314ecb249f3526e9b2f86a0146906108e0908990899061137a565b60405180910390a150505050505050565b81818080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516001925061093891508390611335565b9081526040519081900360200190206003015460000361096d578060405163186a887560e11b8152600401610226919061129b565b82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506109b491508390611335565b9081526040519081900360200190206005015460ff16156109ea5780604051630341716360e51b8152600401610226919061129b565b83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405160019250610a3191508390611335565b90815260405190819003602001902060010154336001600160a01b0390911614801590610a8b5750600181604051610a699190611335565b90815260405190819003602001902060020154336001600160a01b0390911614155b15610aab57604051633fcc3f1760e01b8152336004820152602401610226565b6001808686604051610abe929190611396565b908152604051908190036020018120600501805492151560ff19909316929092179091557f4360f12f602ccecefb32480e5314d0d3f57d38db8f52c76d8fdf4c39596c1c2890610b11908790879061137a565b60405180910390a15050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ba757507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610b9b60008051602061150a833981519152546001600160a01b031690565b6001600160a01b031614155b15610bc55760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b158015610c1257600080fd5b505afa158015610c26573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610c87575060408051601f3d908101601f19168201909252610c84918101906114f0565b60015b610caf57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610226565b60008051602061150a8339815191528114610ce057604051632a87526960e21b815260048101829052602401610226565b610cea8383610d62565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bc55760405163703e46dd60e11b815260040160405180910390fd5b610d40610db8565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b610d6b82610e01565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610db057610cea8282610e66565b610598610edc565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610bc557604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610e3757604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610226565b60008051602061150a83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610e839190611335565b600060405180830381855af49150503d8060008114610ebe576040519150601f19603f3d011682016040523d82523d6000602084013e610ec3565b606091505b5091509150610ed3858383610efb565b95945050505050565b3415610bc55760405163b398979f60e01b815260040160405180910390fd5b606082610f1057610f0b82610f5a565b610f53565b8151158015610f2757506001600160a01b0384163b155b15610f5057604051639996b31560e01b81526001600160a01b0385166004820152602401610226565b50805b9392505050565b805115610f6a5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b604051806040016040528060608152602001610fdb6040518060a0016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081526020016000151581525090565b905290565b80356001600160a01b0381168114610ff757600080fd5b919050565b60008083601f84011261100e57600080fd5b50813567ffffffffffffffff81111561102657600080fd5b60208301915083602082850101111561103e57600080fd5b9250929050565b60008060008060006060868803121561105d57600080fd5b61106686610fe0565b9450602086013567ffffffffffffffff8082111561108357600080fd5b61108f89838a01610ffc565b909650945060408801359150808211156110a857600080fd5b506110b588828901610ffc565b969995985093965092949392505050565b600080602083850312156110d957600080fd5b823567ffffffffffffffff8111156110f057600080fd5b6110fc85828601610ffc565b90969095509350505050565b60005b8381101561112357818101518382015260200161110b565b50506000910152565b60008151808452611144816020860160208601611108565b601f01601f19169290920160200192915050565b602081526000825160c0602084015261117460e084018261112c565b9050602084015160018060a01b038082511660408601528060208301511660608601525060408101516080850152606081015160a08501526080810151151560c0850152508091505092915050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156111ec57600080fd5b6111f583610fe0565b9150602083013567ffffffffffffffff8082111561121257600080fd5b818501915085601f83011261122657600080fd5b813581811115611238576112386111c3565b604051601f8201601f19908116603f01168101908382118183101715611260576112606111c3565b8160405282815288602084870101111561127957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b602081526000610f53602083018461112c565b6000602082840312156112c057600080fd5b610f5382610fe0565b600080600080604085870312156112df57600080fd5b843567ffffffffffffffff808211156112f757600080fd5b61130388838901610ffc565b9096509450602087013591508082111561131c57600080fd5b5061132987828801610ffc565b95989497509550505050565b60008251611347818460208701611108565b9190910192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600061138e602083018486611351565b949350505050565b8183823760009101908152919050565b600181811c908216806113ba57607f821691505b6020821081036113da57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610cea576000816000526020600020601f850160051c810160208610156114095750805b601f850160051c820191505b8181101561142857828155600101611415565b505050505050565b67ffffffffffffffff831115611448576114486111c3565b61145c8361145683546113a6565b836113e0565b6000601f84116001811461149057600085156114785750838201355b600019600387901b1c1916600186901b178355610c26565b600083815260209020601f19861690835b828110156114c157868501358255602094850194600190920191016114a1565b50868210156114de5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006020828403121561150257600080fd5b505191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209a4d3ad6114933db1c502ac96c2ffbfe891b309c6937423b10349128001ffbc564736f6c63430008170033" + "code": "0x60806040526004361061007b5760003560e01c8063ad3cb1cc1161004e578063ad3cb1cc1461010e578063c4d66de81461014c578063dafffa7d1461016c578063f4653a1d1461018c57600080fd5b80631e715511146100805780633633852c146100a25780634f1ef286146100d857806352d1902d146100eb575b600080fd5b34801561008c57600080fd5b506100a061009b366004611045565b6101ac565b005b3480156100ae57600080fd5b506100c26100bd3660046110c6565b6103e2565b6040516100cf9190611158565b60405180910390f35b6100a06100e63660046111d9565b61057d565b3480156100f757600080fd5b5061010061059c565b6040519081526020016100cf565b34801561011a57600080fd5b5061013f604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100cf919061129b565b34801561015857600080fd5b506100a06101673660046112ae565b6105b9565b34801561017857600080fd5b506100a06101873660046112c9565b61069e565b34801561019857600080fd5b506100a06101a73660046110c6565b6108f1565b83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506101f391508390611335565b908152604051908190036020019020600301541561022f5780604051630eb7cd9560e01b8152600401610226919061129b565b60405180910390fd5b60405163af8b5bbf60e01b81527300000000000000000000000000000000000022229063af8b5bbf90610268908890889060040161137a565b60006040518083038186803b15801561028057600080fd5b505af4158015610294573d6000803e3d6000fd5b505050508282600187876040516102ac929190611396565b908152604051908190036020019020916102c7919083611430565b5085600186866040516102db929190611396565b908152604051908190036020018120600190810180546001600160a01b03949094166001600160a01b0319909416939093179092553391906103209088908890611396565b90815260405190819003602001812060020180546001600160a01b03939093166001600160a01b03199093169290921790915542906001906103659088908890611396565b90815260405190819003602001812060030191909155429060019061038d9088908890611396565b908152604051908190036020018120600401919091557f5fccafd09eeeb6a3dc1c80357ee982c00d7fb00a991274a9b96fe4fd7cb60552906103d2908790879061137a565b60405180910390a1505050505050565b6103ea610f83565b82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516001925061043191508390611335565b90815260405190819003602001902060030154600003610466578060405163186a887560e11b8152600401610226919061129b565b60018484604051610478929190611396565b90815260200160405180910390206040518060400160405290816000820180546104a1906113a6565b80601f01602080910402602001604051908101604052809291908181526020018280546104cd906113a6565b801561051a5780601f106104ef5761010080835404028352916020019161051a565b820191906000526020600020905b8154815290600101906020018083116104fd57829003601f168201915b50505091835250506040805160a08101825260018401546001600160a01b0390811682526002850154166020808301919091526003850154928201929092526004840154606082015260059093015460ff16151560808401520152949350505050565b610585610b20565b61058e82610bc7565b6105988282610c2d565b5050565b60006105a6610cef565b5060008051602061150a83398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806106035750805467ffffffffffffffff808416911610155b156106215760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b17815561064c83610d38565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506106e591508390611335565b9081526040519081900360200190206003015460000361071a578060405163186a887560e11b8152600401610226919061129b565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516001925061076191508390611335565b9081526040519081900360200190206005015460ff16156107975780604051630341716360e51b8152600401610226919061129b565b85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506107de91508390611335565b90815260405190819003602001902060010154336001600160a01b039091161480159061083857506001816040516108169190611335565b90815260405190819003602001902060020154336001600160a01b0390911614155b1561085857604051633fcc3f1760e01b8152336004820152602401610226565b84846001898960405161086c929190611396565b90815260405190819003602001902091610887919083611430565b50426001888860405161089b929190611396565b908152604051908190036020018120600401919091557f7e7500a71b0209575a3b4858a2a662e94b0cad314ecb249f3526e9b2f86a0146906108e0908990899061137a565b60405180910390a150505050505050565b81818080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516001925061093891508390611335565b9081526040519081900360200190206003015460000361096d578060405163186a887560e11b8152600401610226919061129b565b82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506109b491508390611335565b9081526040519081900360200190206005015460ff16156109ea5780604051630341716360e51b8152600401610226919061129b565b83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405160019250610a3191508390611335565b90815260405190819003602001902060010154336001600160a01b0390911614801590610a8b5750600181604051610a699190611335565b90815260405190819003602001902060020154336001600160a01b0390911614155b15610aab57604051633fcc3f1760e01b8152336004820152602401610226565b6001808686604051610abe929190611396565b908152604051908190036020018120600501805492151560ff19909316929092179091557f4360f12f602ccecefb32480e5314d0d3f57d38db8f52c76d8fdf4c39596c1c2890610b11908790879061137a565b60405180910390a15050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ba757507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610b9b60008051602061150a833981519152546001600160a01b031690565b6001600160a01b031614155b15610bc55760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b158015610c1257600080fd5b505afa158015610c26573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610c87575060408051601f3d908101601f19168201909252610c84918101906114f0565b60015b610caf57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610226565b60008051602061150a8339815191528114610ce057604051632a87526960e21b815260048101829052602401610226565b610cea8383610d62565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bc55760405163703e46dd60e11b815260040160405180910390fd5b610d40610db8565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b610d6b82610e01565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610db057610cea8282610e66565b610598610edc565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610bc557604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610e3757604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610226565b60008051602061150a83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610e839190611335565b600060405180830381855af49150503d8060008114610ebe576040519150601f19603f3d011682016040523d82523d6000602084013e610ec3565b606091505b5091509150610ed3858383610efb565b95945050505050565b3415610bc55760405163b398979f60e01b815260040160405180910390fd5b606082610f1057610f0b82610f5a565b610f53565b8151158015610f2757506001600160a01b0384163b155b15610f5057604051639996b31560e01b81526001600160a01b0385166004820152602401610226565b50805b9392505050565b805115610f6a5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b604051806040016040528060608152602001610fdb6040518060a0016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081526020016000151581525090565b905290565b80356001600160a01b0381168114610ff757600080fd5b919050565b60008083601f84011261100e57600080fd5b50813567ffffffffffffffff81111561102657600080fd5b60208301915083602082850101111561103e57600080fd5b9250929050565b60008060008060006060868803121561105d57600080fd5b61106686610fe0565b9450602086013567ffffffffffffffff8082111561108357600080fd5b61108f89838a01610ffc565b909650945060408801359150808211156110a857600080fd5b506110b588828901610ffc565b969995985093965092949392505050565b600080602083850312156110d957600080fd5b823567ffffffffffffffff8111156110f057600080fd5b6110fc85828601610ffc565b90969095509350505050565b60005b8381101561112357818101518382015260200161110b565b50506000910152565b60008151808452611144816020860160208601611108565b601f01601f19169290920160200192915050565b602081526000825160c0602084015261117460e084018261112c565b9050602084015160018060a01b038082511660408601528060208301511660608601525060408101516080850152606081015160a08501526080810151151560c0850152508091505092915050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156111ec57600080fd5b6111f583610fe0565b9150602083013567ffffffffffffffff8082111561121257600080fd5b818501915085601f83011261122657600080fd5b813581811115611238576112386111c3565b604051601f8201601f19908116603f01168101908382118183101715611260576112606111c3565b8160405282815288602084870101111561127957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b602081526000610f53602083018461112c565b6000602082840312156112c057600080fd5b610f5382610fe0565b600080600080604085870312156112df57600080fd5b843567ffffffffffffffff808211156112f757600080fd5b61130388838901610ffc565b9096509450602087013591508082111561131c57600080fd5b5061132987828801610ffc565b95989497509550505050565b60008251611347818460208701611108565b9190910192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600061138e602083018486611351565b949350505050565b8183823760009101908152919050565b600181811c908216806113ba57607f821691505b6020821081036113da57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610cea576000816000526020600020601f850160051c810160208610156114095750805b601f850160051c820191505b8181101561142857828155600101611415565b505050505050565b67ffffffffffffffff831115611448576114486111c3565b61145c8361145683546113a6565b836113e0565b6000601f84116001811461149057600085156114785750838201355b600019600387901b1c1916600186901b178355610c26565b600083815260209020601f19861690835b828110156114c157868501358255602094850194600190920191016114a1565b50868210156114de5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006020828403121561150257600080fd5b505191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212206c60c08be5ee01ad08dd959540327e17f5551cf6ba60e0ff67fbb5861e17e34564736f6c63430008170033" }, "0x0000000000000000000000000000000000018888": { "comment": "Proxy: Ethereum registry for ERC-1056 ethr did methods", @@ -197,13 +197,13 @@ "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000003333", "0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000000018888", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000d400ee7483c04facb08a85ac3f5246623b8703d6" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x00000000000000000000000019af7051058be05b8f3dd8544585a51e2e344dc5" } }, - "0xd400ee7483c04facb08a85ac3f5246623b8703d6": { + "0x19af7051058be05b8f3dd8544585a51e2e344dc5": { "comment": "Implementation: Smart contract to resolve DIDs from various DID registries", "balance": "0", - "code": "0x6080604052600436106100555760003560e01c806329181c6c1461005a5780634f1ef2861461009057806352d1902d146100a557806366874f25146100c8578063ad3cb1cc14610135578063c0c53b8b14610166575b600080fd5b34801561006657600080fd5b5061007a61007536600461191c565b610186565b60405161008791906119dd565b60405180910390f35b6100a361009e366004611abc565b6102a8565b005b3480156100b157600080fd5b506100ba6102c7565b604051908152602001610087565b3480156100d457600080fd5b506100e86100e336600461191c565b6102e4565b604051610087919081516001600160a01b03908116825260208084015190911690820152604080830151908201526060808301519082015260809182015115159181019190915260a00190565b34801561014157600080fd5b5061007a604051806040016040528060058152602001640352e302e360dc1b81525081565b34801561017257600080fd5b506100a3610181366004611b4e565b610518565b606060006101c984848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061062c92505050565b90506101d88160000151610777565b1561025e57600154604051630d8ce14b60e21b81526001600160a01b0390911690633633852c9061020f9087908790600401611b99565b600060405180830381865afa15801561022c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102549190810190611bc8565b5191506102a29050565b80516040516102709190602001611ce7565b60408051601f198184030181529082905263fdc1b5c360e01b825261029791600401611d37565b60405180910390fd5b505b92915050565b6102b0610817565b6102b9826108be565b6102c38282610924565b5050565b60006102d16109e6565b50600080516020611f4783398151915290565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152600061035084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061062c92505050565b905061035f8160000151610a2f565b1561044c5760006103738260200151610a68565b90506001600160a01b0381166103a0578484604051631859e3bb60e11b8152600401610297929190611b99565b6002546040516310e67a9d60e31b81526001600160a01b0383811660048301526000921690638733d4e890602401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611d8b565b6040805160a0810182526001600160a01b03909216825260006020830181905290820181905260608201819052608082015293506102a292505050565b805161045790610777565b156104df57600154604051630d8ce14b60e21b81526001600160a01b0390911690633633852c9061048e9087908790600401611b99565b600060405180830381865afa1580156104ab573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104d39190810190611bc8565b602001519150506102a2565b80516040516104f19190602001611ce7565b60408051601f198184030181529082905263fdc1b5c360e01b825261029791600401611da8565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff1680610561575080546001600160401b03808416911610155b1561057f5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b1781556105a985610aa1565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff0000000000000000191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b6040805180820190915260608082526020820152600061064b83610acb565b90506000610671604051806040016040528060018152602001601d60f91b815250610acb565b90506000806106808484610ad6565b9550925090508015806106be57506106bc6106b560405180604001604052806003815260200162191a5960ea1b815250610acb565b8390610b24565b155b156106de5785604051631859e3bb60e11b815260040161029791906119dd565b6106e88484610ad6565b9550925090508061070e5785604051631859e3bb60e11b815260040161029791906119dd565b604080518082019091526060808252602082015261072b83610b30565b81526040805180820190915260018152601d60f91b60208201526107599061075290610acb565b8690610b3b565b94506107689150849050610b30565b60208201529695505050505050565b60008061078383610acb565b90506107b46107ad60405180604001604052806004815260200163696e647960e01b815250610acb565b8290610b24565b806107e357506107e36107ad6040518060400160405280600581526020016434b7323c9960d91b815250610acb565b8061081057506108106107ad6040518060400160405280600381526020016239b7bb60e91b815250610acb565b9392505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061089e57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610892600080516020611f47833981519152546001600160a01b031690565b6001600160a01b031614155b156108bc5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561090957600080fd5b505afa15801561091d573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561097e575060408051601f3d908101601f1916820190925261097b91810190611dfc565b60015b6109a657604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610297565b600080516020611f4783398151915281146109d757604051632a87526960e21b815260048101829052602401610297565b6109e18383610b65565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108bc5760405163703e46dd60e11b815260040160405180910390fd5b60006102a2610a596040518060400160405280600481526020016332ba343960e11b815250610acb565b610a6284610acb565b90610b24565b60006016610a74835190565b03610a8157506000919050565b6000610a8c83610bbb565b9050610a9781611e15565b60601c9392505050565b610aa9610dad565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006102a282610df6565b6000808080610ae58686610e0a565b90506000198103610b0157600086600093509350935050610b1d565b610b1586826001600160801b038816610f15565b935093509350505b9250925092565b60006108108383610f82565b60606102a282610fcc565b6000808080610b4a8686611043565b90506000198103610b01576000808793509350935050610b1d565b610b6e82611135565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610bb3576109e1828261119a565b6102c3611210565b60606000610bc883610acb565b90506000610bef60405180604001604052806002815260200161060f60f31b815250610acb565b9050610c1e610c1760405180604001604052806002815260200161060f60f31b815250610acb565b839061122f565b610c3957505060408051602081019091526000815292915050565b610c4b610c46838361123b565b610b30565b93506000849050600060028251610c629190611e67565b6001600160401b03811115610c7957610c79611a05565b6040519080825280601f01601f191660200182016040528015610ca3576020820181803683370190505b50905060005b8151811015610da357600080610ce885610cc4856002611e89565b81518110610cd457610cd4611ea0565b01602001516001600160f81b031916611247565b9150915080610d0d575050604080516020810190915260008152979650505050505050565b600080610d2a87610d1f876002611e89565b610cc4906001611eb6565b9150915080610d515750506040805160208101909152600081529998505050505050505050565b81610d5d856010611ec9565b610d679190611ee5565b60f81b868681518110610d7c57610d7c611ea0565b60200101906001600160f81b031916908160001a9053505060019093019250610ca9915050565b5095945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166108bc57604051631afcd79f60e31b815260040160405180910390fd5b60008060208301905061081081845161132d565b60006001600160801b03838116908316808303610e2c576000925050506102a2565b811580610e3857508181115b15610e4957600019925050506102a2565b6000610e558660801c90565b90506000610e638660801c90565b90506000610e72825160001a90565b90505b6000610e82848784611339565b90506000198103610e9d5760001996505050505050506102a2565b94859003949283019285851115610ebe5760001996505050505050506102a2565b84832085852003610eea57610ed38960801c90565b610edd9085611efe565b96505050505050506102a2565b85600103610f025760001996505050505050506102a2565b6000199095019460019093019250610e75565b600080600080610f258760801c90565b90506001600160801b03871685870181811115610f55576040516365f4e9df60e01b815260040160405180910390fd5b6001996001600160801b03988916608085811b919091179a50928290039098169201901b17949350505050565b60006001600160801b038381169083168114610fa25760009150506102a2565b610fc4610faf8560801c90565b610fb98560801c90565b839081902091201490565b949350505050565b60606001600160801b0382166001600160401b03811115610fef57610fef611a05565b6040519080825280601f01601f191660200182016040528015611019576020820181803683370190505b5090506020810161103d8161102e8560801c90565b6001600160801b038616611401565b50919050565b60006001600160801b03838116908316808303611065576000925050506102a2565b81158061107157508181115b1561108257600019925050506102a2565b600061108e8660801c90565b9050600061109c8660801c90565b905060006110a98761140f565b905060001984015b60006110be858885611454565b905060001981036110da576000199750505050505050506102a2565b808211156110f3576000199750505050505050506102a2565b8584208282038681018890209091036111155797506102a29650505050505050565b8115611123575095506110b1565b600019985050505050505050506102a2565b806001600160a01b03163b60000361116b57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610297565b600080516020611f4783398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516111b79190611f11565b600060405180830381855af49150503d80600081146111f2576040519150601f19603f3d011682016040523d82523d6000602084013e6111f7565b606091505b5091509150611207858383611508565b95945050505050565b34156108bc5760405163b398979f60e01b815260040160405180910390fd5b60006108108383611564565b600061081083836115b1565b600080600360fc1b6001600160f81b03198416108015906112765750603960f81b6001600160f81b0319841611155b156112945761128a603060f885901c611f2d565b9360019350915050565b604160f81b6001600160f81b03198416108015906112c05750602360f91b6001600160f81b0319841611155b156112e05760416112d660f885901c600a611ee5565b61128a9190611f2d565b606160f81b6001600160f81b031984161080159061130c5750603360f91b6001600160f81b0319841611155b156113225760616112d660f885901c600a611ee5565b506000928392509050565b6000610810838361160b565b6000602083116113555761134e848484611617565b9050610810565b83601f8416808503820160ff8516600080516020611f67833981519152025b818810156113b6578751811861138981611728565b156113aa5784890361139d8a60208a611617565b0195505050505050610810565b60208901985050611374565b826000036113cc57600019945050505050610810565b6113d7828488611617565b945060001985036113f057600019945050505050610810565b509190910391909101949350505050565b8083828460045afa50505050565b60006001600160801b03821680820361143b576040516365f4e9df60e01b815260040160405180910390fd5b6108106001820361144c8560801c90565b015160001a90565b6000602083116114695761134e848484611773565b601f831684840181156114a1578190036000611486828487611773565b9050600019811461149f57908690030191506108109050565b505b60ff8416600080516020611f67833981519152025b868211156114fa57601f19909101805190919081186114d481611728565b156114f4578783036114e884602089611773565b01945050505050610810565b506114b6565b506000199695505050505050565b60608261151d57611518826117bc565b610810565b815115801561153457506001600160a01b0384163b155b1561155d57604051639996b31560e01b81526001600160a01b0385166004820152602401610297565b5080610810565b60006001600160801b0383811690831680821015611587576000925050506102a2565b848183111561159d5761159a86836117e8565b90505b6115a78186610f82565b9695505050505050565b60006001600160801b03838116908316818111156115d35784925050506102a2565b6000806115e08784611833565b90925090506115ef8287610f82565b156115ff5793506102a292505050565b869450505050506102a2565b600061081083836118b6565b825160009081602085111561162b57602094505b601285106116b55760ff8416600080516020611f6783398151915202821861165b6001600160801b038217611728565b6000036116915760109150601a861061168c576116806001600160401b038217611728565b60000361168c57601891505b6116af565b6116a36001600160c01b038217611728565b6000036116af57600891505b506116f3565b600a85106116f35760ff8416600080516020611f678339815191520282186116e56001600160c01b038217611728565b6000036116f157600891505b505b8481101561171b5781811a60ff85168103611712575091506108109050565b506001016116f3565b5060001995945050505050565b7ffefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefeff81019019167f80808080808080808080808080808080808080808080808080808080808080801690565b6000602083111561178357602092505b83515b83156117b0576000199093019280841a60ff841681036117aa578492505050610810565b50611786565b50600019949350505050565b8051156117cc5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b60006001600160801b03831680831115611815576040516365f4e9df60e01b815260040160405180910390fd5b610fc46118228560801c90565b60801b6001600160801b0385161790565b60008060006118428560801c90565b90506001600160801b0385168085111561186f576040516365f4e9df60e01b815260040160405180910390fd5b608082901b6001600160801b038616176118a961188c8785611eb6565b6118968885611efe565b6001600160801b031660809190911b1790565b9350935050509250929050565b60006001600160801b038311156118e05760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b0382111561190857604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b6000806020838503121561192f57600080fd5b82356001600160401b038082111561194657600080fd5b818501915085601f83011261195a57600080fd5b81358181111561196957600080fd5b86602082850101111561197b57600080fd5b60209290920196919550909350505050565b60005b838110156119a8578181015183820152602001611990565b50506000910152565b600081518084526119c981602086016020860161198d565b601f01601f19169290920160200192915050565b60208152600061081060208301846119b1565b6001600160a01b03811681146117e557600080fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611a3d57611a3d611a05565b60405290565b60405160a081016001600160401b0381118282101715611a3d57611a3d611a05565b604051601f8201601f191681016001600160401b0381118282101715611a8d57611a8d611a05565b604052919050565b60006001600160401b03821115611aae57611aae611a05565b50601f01601f191660200190565b60008060408385031215611acf57600080fd5b8235611ada816119f0565b915060208301356001600160401b03811115611af557600080fd5b8301601f81018513611b0657600080fd5b8035611b19611b1482611a95565b611a65565b818152866020838501011115611b2e57600080fd5b816020840160208301376000602083830101528093505050509250929050565b600080600060608486031215611b6357600080fd5b8335611b6e816119f0565b92506020840135611b7e816119f0565b91506040840135611b8e816119f0565b809150509250925092565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020808385031215611bdb57600080fd5b82516001600160401b0380821115611bf257600080fd5b9084019081860360c0811215611c0757600080fd5b611c0f611a1b565b835183811115611c1e57600080fd5b84019250601f83018813611c3157600080fd5b8251611c3f611b1482611a95565b8181528987838701011115611c5357600080fd5b611c628288830189880161198d565b82525060a0601f1983011215611c7757600080fd5b611c7f611a43565b9250848401519150611c90826119f0565b908252604083015190611ca2826119f0565b8185840152606084015160408401526080840151606084015260a084015193508315158414611cd057600080fd5b608083019390935250918101919091529392505050565b7f556e737570706f7274656420444944204d6574686f643a202700000000000000815260008251611d1f81601985016020870161198d565b602760f81b6019939091019283015250601a01919050565b60408152602460408201527f556e6976657273616c4469645265736f6c7665722e7265736f6c7665446f63756060820152631b595b9d60e21b608082015260a06020820152600061081060a08301846119b1565b600060208284031215611d9d57600080fd5b8151610810816119f0565b60408152602460408201527f556e6976657273616c4469645265736f6c7665722e7265736f6c76654d6574616060820152636461746160e01b608082015260a06020820152600061081060a08301846119b1565b600060208284031215611e0e57600080fd5b5051919050565b805160208201516bffffffffffffffffffffffff198082169291906014831015611e495780818460140360031b1b83161693505b505050919050565b634e487b7160e01b600052601160045260246000fd5b600082611e8457634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176102a2576102a2611e51565b634e487b7160e01b600052603260045260246000fd5b808201808211156102a2576102a2611e51565b60ff81811683821602908116908181146102a0576102a0611e51565b60ff81811683821601908111156102a2576102a2611e51565b818103818111156102a2576102a2611e51565b60008251611f2381846020870161198d565b9190910192915050565b60ff82811682821603908111156102a2576102a2611e5156fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc0101010101010101010101010101010101010101010101010101010101010101a264697066735822122044705fbc848c4daa0671e8e6e6b375afe66e66cc889c42f434906d6446f271cb64736f6c63430008170033" + "code": "0x6080604052600436106100555760003560e01c806329181c6c1461005a5780634f1ef2861461009057806352d1902d146100a557806366874f25146100c8578063ad3cb1cc14610135578063c0c53b8b14610166575b600080fd5b34801561006657600080fd5b5061007a61007536600461191c565b610186565b60405161008791906119dd565b60405180910390f35b6100a361009e366004611abc565b6102a8565b005b3480156100b157600080fd5b506100ba6102c7565b604051908152602001610087565b3480156100d457600080fd5b506100e86100e336600461191c565b6102e4565b604051610087919081516001600160a01b03908116825260208084015190911690820152604080830151908201526060808301519082015260809182015115159181019190915260a00190565b34801561014157600080fd5b5061007a604051806040016040528060058152602001640352e302e360dc1b81525081565b34801561017257600080fd5b506100a3610181366004611b4e565b610518565b606060006101c984848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061062c92505050565b90506101d88160000151610777565b1561025e57600154604051630d8ce14b60e21b81526001600160a01b0390911690633633852c9061020f9087908790600401611b99565b600060405180830381865afa15801561022c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102549190810190611bc8565b5191506102a29050565b80516040516102709190602001611ce7565b60408051601f198184030181529082905263fdc1b5c360e01b825261029791600401611d37565b60405180910390fd5b505b92915050565b6102b0610817565b6102b9826108be565b6102c38282610924565b5050565b60006102d16109e6565b50600080516020611f4783398151915290565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152600061035084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061062c92505050565b905061035f8160000151610a2f565b1561044c5760006103738260200151610a68565b90506001600160a01b0381166103a0578484604051631859e3bb60e11b8152600401610297929190611b99565b6002546040516310e67a9d60e31b81526001600160a01b0383811660048301526000921690638733d4e890602401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611d8b565b6040805160a0810182526001600160a01b03909216825260006020830181905290820181905260608201819052608082015293506102a292505050565b805161045790610777565b156104df57600154604051630d8ce14b60e21b81526001600160a01b0390911690633633852c9061048e9087908790600401611b99565b600060405180830381865afa1580156104ab573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104d39190810190611bc8565b602001519150506102a2565b80516040516104f19190602001611ce7565b60408051601f198184030181529082905263fdc1b5c360e01b825261029791600401611da8565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff1680610561575080546001600160401b03808416911610155b1561057f5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b1781556105a985610aa1565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff0000000000000000191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b6040805180820190915260608082526020820152600061064b83610acb565b90506000610671604051806040016040528060018152602001601d60f91b815250610acb565b90506000806106808484610ad6565b9550925090508015806106be57506106bc6106b560405180604001604052806003815260200162191a5960ea1b815250610acb565b8390610b24565b155b156106de5785604051631859e3bb60e11b815260040161029791906119dd565b6106e88484610ad6565b9550925090508061070e5785604051631859e3bb60e11b815260040161029791906119dd565b604080518082019091526060808252602082015261072b83610b30565b81526040805180820190915260018152601d60f91b60208201526107599061075290610acb565b8690610b3b565b94506107689150849050610b30565b60208201529695505050505050565b60008061078383610acb565b90506107b46107ad60405180604001604052806004815260200163696e647960e01b815250610acb565b8290610b24565b806107e357506107e36107ad6040518060400160405280600581526020016434b7323c9960d91b815250610acb565b8061081057506108106107ad6040518060400160405280600381526020016239b7bb60e91b815250610acb565b9392505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061089e57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610892600080516020611f47833981519152546001600160a01b031690565b6001600160a01b031614155b156108bc5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561090957600080fd5b505afa15801561091d573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561097e575060408051601f3d908101601f1916820190925261097b91810190611dfc565b60015b6109a657604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610297565b600080516020611f4783398151915281146109d757604051632a87526960e21b815260048101829052602401610297565b6109e18383610b65565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108bc5760405163703e46dd60e11b815260040160405180910390fd5b60006102a2610a596040518060400160405280600481526020016332ba343960e11b815250610acb565b610a6284610acb565b90610b24565b60006016610a74835190565b03610a8157506000919050565b6000610a8c83610bbb565b9050610a9781611e15565b60601c9392505050565b610aa9610dad565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006102a282610df6565b6000808080610ae58686610e0a565b90506000198103610b0157600086600093509350935050610b1d565b610b1586826001600160801b038816610f15565b935093509350505b9250925092565b60006108108383610f82565b60606102a282610fcc565b6000808080610b4a8686611043565b90506000198103610b01576000808793509350935050610b1d565b610b6e82611135565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610bb3576109e1828261119a565b6102c3611210565b60606000610bc883610acb565b90506000610bef60405180604001604052806002815260200161060f60f31b815250610acb565b9050610c1e610c1760405180604001604052806002815260200161060f60f31b815250610acb565b839061122f565b610c3957505060408051602081019091526000815292915050565b610c4b610c46838361123b565b610b30565b93506000849050600060028251610c629190611e67565b6001600160401b03811115610c7957610c79611a05565b6040519080825280601f01601f191660200182016040528015610ca3576020820181803683370190505b50905060005b8151811015610da357600080610ce885610cc4856002611e89565b81518110610cd457610cd4611ea0565b01602001516001600160f81b031916611247565b9150915080610d0d575050604080516020810190915260008152979650505050505050565b600080610d2a87610d1f876002611e89565b610cc4906001611eb6565b9150915080610d515750506040805160208101909152600081529998505050505050505050565b81610d5d856010611ec9565b610d679190611ee5565b60f81b868681518110610d7c57610d7c611ea0565b60200101906001600160f81b031916908160001a9053505060019093019250610ca9915050565b5095945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166108bc57604051631afcd79f60e31b815260040160405180910390fd5b60008060208301905061081081845161132d565b60006001600160801b03838116908316808303610e2c576000925050506102a2565b811580610e3857508181115b15610e4957600019925050506102a2565b6000610e558660801c90565b90506000610e638660801c90565b90506000610e72825160001a90565b90505b6000610e82848784611339565b90506000198103610e9d5760001996505050505050506102a2565b94859003949283019285851115610ebe5760001996505050505050506102a2565b84832085852003610eea57610ed38960801c90565b610edd9085611efe565b96505050505050506102a2565b85600103610f025760001996505050505050506102a2565b6000199095019460019093019250610e75565b600080600080610f258760801c90565b90506001600160801b03871685870181811115610f55576040516365f4e9df60e01b815260040160405180910390fd5b6001996001600160801b03988916608085811b919091179a50928290039098169201901b17949350505050565b60006001600160801b038381169083168114610fa25760009150506102a2565b610fc4610faf8560801c90565b610fb98560801c90565b839081902091201490565b949350505050565b60606001600160801b0382166001600160401b03811115610fef57610fef611a05565b6040519080825280601f01601f191660200182016040528015611019576020820181803683370190505b5090506020810161103d8161102e8560801c90565b6001600160801b038616611401565b50919050565b60006001600160801b03838116908316808303611065576000925050506102a2565b81158061107157508181115b1561108257600019925050506102a2565b600061108e8660801c90565b9050600061109c8660801c90565b905060006110a98761140f565b905060001984015b60006110be858885611454565b905060001981036110da576000199750505050505050506102a2565b808211156110f3576000199750505050505050506102a2565b8584208282038681018890209091036111155797506102a29650505050505050565b8115611123575095506110b1565b600019985050505050505050506102a2565b806001600160a01b03163b60000361116b57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610297565b600080516020611f4783398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516111b79190611f11565b600060405180830381855af49150503d80600081146111f2576040519150601f19603f3d011682016040523d82523d6000602084013e6111f7565b606091505b5091509150611207858383611508565b95945050505050565b34156108bc5760405163b398979f60e01b815260040160405180910390fd5b60006108108383611564565b600061081083836115b1565b600080600360fc1b6001600160f81b03198416108015906112765750603960f81b6001600160f81b0319841611155b156112945761128a603060f885901c611f2d565b9360019350915050565b604160f81b6001600160f81b03198416108015906112c05750602360f91b6001600160f81b0319841611155b156112e05760416112d660f885901c600a611ee5565b61128a9190611f2d565b606160f81b6001600160f81b031984161080159061130c5750603360f91b6001600160f81b0319841611155b156113225760616112d660f885901c600a611ee5565b506000928392509050565b6000610810838361160b565b6000602083116113555761134e848484611617565b9050610810565b83601f8416808503820160ff8516600080516020611f67833981519152025b818810156113b6578751811861138981611728565b156113aa5784890361139d8a60208a611617565b0195505050505050610810565b60208901985050611374565b826000036113cc57600019945050505050610810565b6113d7828488611617565b945060001985036113f057600019945050505050610810565b509190910391909101949350505050565b8083828460045afa50505050565b60006001600160801b03821680820361143b576040516365f4e9df60e01b815260040160405180910390fd5b6108106001820361144c8560801c90565b015160001a90565b6000602083116114695761134e848484611773565b601f831684840181156114a1578190036000611486828487611773565b9050600019811461149f57908690030191506108109050565b505b60ff8416600080516020611f67833981519152025b868211156114fa57601f19909101805190919081186114d481611728565b156114f4578783036114e884602089611773565b01945050505050610810565b506114b6565b506000199695505050505050565b60608261151d57611518826117bc565b610810565b815115801561153457506001600160a01b0384163b155b1561155d57604051639996b31560e01b81526001600160a01b0385166004820152602401610297565b5080610810565b60006001600160801b0383811690831680821015611587576000925050506102a2565b848183111561159d5761159a86836117e8565b90505b6115a78186610f82565b9695505050505050565b60006001600160801b03838116908316818111156115d35784925050506102a2565b6000806115e08784611833565b90925090506115ef8287610f82565b156115ff5793506102a292505050565b869450505050506102a2565b600061081083836118b6565b825160009081602085111561162b57602094505b601285106116b55760ff8416600080516020611f6783398151915202821861165b6001600160801b038217611728565b6000036116915760109150601a861061168c576116806001600160401b038217611728565b60000361168c57601891505b6116af565b6116a36001600160c01b038217611728565b6000036116af57600891505b506116f3565b600a85106116f35760ff8416600080516020611f678339815191520282186116e56001600160c01b038217611728565b6000036116f157600891505b505b8481101561171b5781811a60ff85168103611712575091506108109050565b506001016116f3565b5060001995945050505050565b7ffefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefeff81019019167f80808080808080808080808080808080808080808080808080808080808080801690565b6000602083111561178357602092505b83515b83156117b0576000199093019280841a60ff841681036117aa578492505050610810565b50611786565b50600019949350505050565b8051156117cc5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b60006001600160801b03831680831115611815576040516365f4e9df60e01b815260040160405180910390fd5b610fc46118228560801c90565b60801b6001600160801b0385161790565b60008060006118428560801c90565b90506001600160801b0385168085111561186f576040516365f4e9df60e01b815260040160405180910390fd5b608082901b6001600160801b038616176118a961188c8785611eb6565b6118968885611efe565b6001600160801b031660809190911b1790565b9350935050509250929050565b60006001600160801b038311156118e05760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b0382111561190857604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b6000806020838503121561192f57600080fd5b82356001600160401b038082111561194657600080fd5b818501915085601f83011261195a57600080fd5b81358181111561196957600080fd5b86602082850101111561197b57600080fd5b60209290920196919550909350505050565b60005b838110156119a8578181015183820152602001611990565b50506000910152565b600081518084526119c981602086016020860161198d565b601f01601f19169290920160200192915050565b60208152600061081060208301846119b1565b6001600160a01b03811681146117e557600080fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611a3d57611a3d611a05565b60405290565b60405160a081016001600160401b0381118282101715611a3d57611a3d611a05565b604051601f8201601f191681016001600160401b0381118282101715611a8d57611a8d611a05565b604052919050565b60006001600160401b03821115611aae57611aae611a05565b50601f01601f191660200190565b60008060408385031215611acf57600080fd5b8235611ada816119f0565b915060208301356001600160401b03811115611af557600080fd5b8301601f81018513611b0657600080fd5b8035611b19611b1482611a95565b611a65565b818152866020838501011115611b2e57600080fd5b816020840160208301376000602083830101528093505050509250929050565b600080600060608486031215611b6357600080fd5b8335611b6e816119f0565b92506020840135611b7e816119f0565b91506040840135611b8e816119f0565b809150509250925092565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020808385031215611bdb57600080fd5b82516001600160401b0380821115611bf257600080fd5b9084019081860360c0811215611c0757600080fd5b611c0f611a1b565b835183811115611c1e57600080fd5b84019250601f83018813611c3157600080fd5b8251611c3f611b1482611a95565b8181528987838701011115611c5357600080fd5b611c628288830189880161198d565b82525060a0601f1983011215611c7757600080fd5b611c7f611a43565b9250848401519150611c90826119f0565b908252604083015190611ca2826119f0565b8185840152606084015160408401526080840151606084015260a084015193508315158414611cd057600080fd5b608083019390935250918101919091529392505050565b7f556e737570706f7274656420444944204d6574686f643a202700000000000000815260008251611d1f81601985016020870161198d565b602760f81b6019939091019283015250601a01919050565b60408152602460408201527f556e6976657273616c4469645265736f6c7665722e7265736f6c7665446f63756060820152631b595b9d60e21b608082015260a06020820152600061081060a08301846119b1565b600060208284031215611d9d57600080fd5b8151610810816119f0565b60408152602460408201527f556e6976657273616c4469645265736f6c7665722e7265736f6c76654d6574616060820152636461746160e01b608082015260a06020820152600061081060a08301846119b1565b600060208284031215611e0e57600080fd5b5051919050565b805160208201516bffffffffffffffffffffffff198082169291906014831015611e495780818460140360031b1b83161693505b505050919050565b634e487b7160e01b600052601160045260246000fd5b600082611e8457634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176102a2576102a2611e51565b634e487b7160e01b600052603260045260246000fd5b808201808211156102a2576102a2611e51565b60ff81811683821602908116908181146102a0576102a0611e51565b60ff81811683821601908111156102a2576102a2611e51565b818103818111156102a2576102a2611e51565b60008251611f2381846020870161198d565b9190910192915050565b60ff82811682821603908111156102a2576102a2611e5156fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc0101010101010101010101010101010101010101010101010101010101010101a26469706673582212206bdba7dd1c65c24acf98477fe3edb17b5eef1f76f8d1efe71cbbc1007602b69364736f6c63430008170033" }, "0x0000000000000000000000000000000000005555": { "comment": "Proxy: Smart contract to manage schemas", @@ -213,13 +213,13 @@ "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000019999", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000cb69afb4aa332708f86210a988cd1885bb1dcd41" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000002ce63a2ce76a565cab8b3279eb8dea2973f1b504" } }, - "0xcb69afb4aa332708f86210a988cd1885bb1dcd41": { + "0x2ce63a2ce76a565cab8b3279eb8dea2973f1b504": { "comment": "Implementation: Smart contract to manage schemas", "balance": "0", - "code": "0x6080604052600436106100555760003560e01c806336ce177d1461005a578063485cc9551461007c5780634f1ef2861461009c57806352d1902d146100af578063ad3cb1cc146100d7578063bd7fc5eb14610115575b600080fd5b34801561006657600080fd5b5061007a610075366004610e37565b610142565b005b34801561008857600080fd5b5061007a610097366004610ee6565b61045f565b61007a6100aa366004610f66565b610560565b3480156100bb57600080fd5b506100c461057f565b6040519081526020015b60405180910390f35b3480156100e357600080fd5b50610108604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100ce919061105e565b34801561012157600080fd5b50610135610130366004611071565b61059c565b6040516100ce91906110b3565b85858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405160029250610189915083906110e6565b90815260405190819003602001902060010154156101c5578060405163012f5f2760e11b81526004016101bc919061105e565b60405180910390fd5b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506001546040516366874f2560e01b81526001600160a01b0390911692506366874f25915061022b90849060040161105e565b60a060405180830381865afa925050508015610264575060408051601f3d908101601f1916820190925261026191810190611102565b60015b610309573d808015610292576040519150601f19603f3d011682016040523d82523d6000602084013e610297565b606091505b506102a98163186a887560e11b6106fb565b156102c95781604051634c92543b60e01b81526004016101bc919061105e565b6102da81631859e3bb60e11b6106fb565b156102fa578160405163046cb69560e21b81526004016101bc919061105e565b6103038161072b565b50610380565b80516001600160a01b03163314801590610339575080602001516001600160a01b0316336001600160a01b031614155b1561035957604051633fcc3f1760e01b81523360048201526024016101bc565b80608001511561037e57816040516350943b5760e11b81526004016101bc919061105e565b505b6103c586868a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294939250506107379050565b838360028a8a6040516103d992919061118f565b908152604051908190036020019020916103f4919083611229565b50426002898960405161040892919061118f565b908152604051908190036020018120600101919091557f4caa3c04537f182db18e883a82444b9f9a8a6765fba869bb25cfa69694e7b8cf9061044d908a908a906112e9565b60405180910390a15050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806104a95750805467ffffffffffffffff808416911610155b156104c75760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556104f2846107cc565b600180546001600160a01b0319166001600160a01b038516179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6105686107f6565b6105718261089d565b61057b8282610903565b5050565b60006105896109c5565b5060008051602061138383398151915290565b6105a4610dc1565b82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600292506105eb915083906110e6565b90815260405190819003602001902060010154600003610620578060405163272a91e160e21b81526004016101bc919061105e565b6002848460405161063292919061118f565b908152602001604051809103902060405180604001604052908160008201805461065b9061119f565b80601f01602080910402602001604051908101604052809291908181526020018280546106879061119f565b80156106d45780601f106106a9576101008083540402835291602001916106d4565b820191906000526020600020905b8154815290600101906020018083116106b757829003601f168201915b50505091835250506040805160208082019092526001939093015483520152949350505050565b600080838060200190518101906107129190611318565b6001600160e01b03198481169116149150505b92915050565b60208101815182018082fd5b60008282604051806040016040528060158152602001742f616e6f6e63726564732f76302f534348454d412f60581b81525060405160200161077b93929190611342565b60405160208183030381529060405290506107a761079882610a0e565b6107a186610a0e565b90610a19565b6107c6578360405163ba33fe2160e01b81526004016101bc919061105e565b50505050565b6107d4610a2c565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061087d57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610871600080516020611383833981519152546001600160a01b031690565b6001600160a01b031614155b1561089b5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b1580156108e857600080fd5b505afa1580156108fc573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561095d575060408051601f3d908101601f1916820190925261095a91810190611369565b60015b61098557604051634c9c8ce360e01b81526001600160a01b03831660048201526024016101bc565b60008051602061138383398151915281146109b657604051632a87526960e21b8152600481018290526024016101bc565b6109c08383610a75565b505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461089b5760405163703e46dd60e11b815260040160405180910390fd5b600061072582610acb565b6000610a258383610adf565b9392505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661089b57604051631afcd79f60e31b815260040160405180910390fd5b610a7e82610b2c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610ac3576109c08282610b91565b61057b610c07565b600080602083019050610a25818451610c26565b60006001600160801b0383811690831680821015610b0257600092505050610725565b8481831115610b1857610b158683610c32565b90505b610b228186610c85565b9695505050505050565b806001600160a01b03163b600003610b6257604051634c9c8ce360e01b81526001600160a01b03821660048201526024016101bc565b60008051602061138383398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610bae91906110e6565b600060405180830381855af49150503d8060008114610be9576040519150601f19603f3d011682016040523d82523d6000602084013e610bee565b606091505b5091509150610bfe858383610cc7565b95945050505050565b341561089b5760405163b398979f60e01b815260040160405180910390fd5b6000610a258383610d23565b60006001600160801b03831680831115610c5f576040516365f4e9df60e01b815260040160405180910390fd5b610c7d610c6c8560801c90565b60801b6001600160801b0385161790565b949350505050565b60006001600160801b038381169083168114610ca5576000915050610725565b610c7d610cb28560801c90565b610cbc8560801c90565b839081902091201490565b606082610cdc57610cd782610d2f565b610a25565b8151158015610cf357506001600160a01b0384163b155b15610d1c57604051639996b31560e01b81526001600160a01b03851660048201526024016101bc565b5092915050565b6000610a258383610d5b565b805115610d3f5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b60006001600160801b03831115610d855760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b03821115610dad57604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b604051806040016040528060608152602001610de96040518060200160405280600081525090565b905290565b60008083601f840112610e0057600080fd5b50813567ffffffffffffffff811115610e1857600080fd5b602083019150836020828501011115610e3057600080fd5b9250929050565b60008060008060008060608789031215610e5057600080fd5b863567ffffffffffffffff80821115610e6857600080fd5b610e748a838b01610dee565b90985096506020890135915080821115610e8d57600080fd5b610e998a838b01610dee565b90965094506040890135915080821115610eb257600080fd5b50610ebf89828a01610dee565b979a9699509497509295939492505050565b6001600160a01b0381168114610d5857600080fd5b60008060408385031215610ef957600080fd5b8235610f0481610ed1565b91506020830135610f1481610ed1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610f5e57610f5e610f1f565b604052919050565b60008060408385031215610f7957600080fd5b8235610f8481610ed1565b915060208381013567ffffffffffffffff80821115610fa257600080fd5b818601915086601f830112610fb657600080fd5b813581811115610fc857610fc8610f1f565b610fda601f8201601f19168501610f35565b91508082528784828501011115610ff057600080fd5b80848401858401376000848284010152508093505050509250929050565b60005b83811015611029578181015183820152602001611011565b50506000910152565b6000815180845261104a81602086016020860161100e565b601f01601f19169290920160200192915050565b602081526000610a256020830184611032565b6000806020838503121561108457600080fd5b823567ffffffffffffffff81111561109b57600080fd5b6110a785828601610dee565b90969095509350505050565b6020815260008251604060208401526110cf6060840182611032565b905060208401515160408401528091505092915050565b600082516110f881846020870161100e565b9190910192915050565b600060a0828403121561111457600080fd5b60405160a0810181811067ffffffffffffffff8211171561113757611137610f1f565b604052825161114581610ed1565b8152602083015161115581610ed1565b8060208301525060408301516040820152606083015160608201526080830151801515811461118357600080fd5b60808201529392505050565b8183823760009101908152919050565b600181811c908216806111b357607f821691505b6020821081036111d357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156109c0576000816000526020600020601f850160051c810160208610156112025750805b601f850160051c820191505b818110156112215782815560010161120e565b505050505050565b67ffffffffffffffff83111561124157611241610f1f565b6112558361124f835461119f565b836111d9565b6000601f84116001811461128957600085156112715750838201355b600019600387901b1c1916600186901b1783556108fc565b600083815260209020601f19861690835b828110156112ba578685013582556020948501946001909201910161129a565b50868210156112d75760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561132a57600080fd5b81516001600160e01b031981168114610a2557600080fd5b82848237600083820160008152835161135f81836020880161100e565b0195945050505050565b60006020828403121561137b57600080fd5b505191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220610feefa69ff683451b4ec2d1e34b52eb35229228dc2caa5632873a2656b814f64736f6c63430008170033" + "code": "0x6080604052600436106100555760003560e01c806336ce177d1461005a578063485cc9551461007c5780634f1ef2861461009c57806352d1902d146100af578063ad3cb1cc146100d7578063bd7fc5eb14610115575b600080fd5b34801561006657600080fd5b5061007a610075366004610e37565b610142565b005b34801561008857600080fd5b5061007a610097366004610ee6565b61045f565b61007a6100aa366004610f66565b610560565b3480156100bb57600080fd5b506100c461057f565b6040519081526020015b60405180910390f35b3480156100e357600080fd5b50610108604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100ce919061105e565b34801561012157600080fd5b50610135610130366004611071565b61059c565b6040516100ce91906110b3565b85858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405160029250610189915083906110e6565b90815260405190819003602001902060010154156101c5578060405163012f5f2760e11b81526004016101bc919061105e565b60405180910390fd5b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506001546040516366874f2560e01b81526001600160a01b0390911692506366874f25915061022b90849060040161105e565b60a060405180830381865afa925050508015610264575060408051601f3d908101601f1916820190925261026191810190611102565b60015b610309573d808015610292576040519150601f19603f3d011682016040523d82523d6000602084013e610297565b606091505b506102a98163186a887560e11b6106fb565b156102c95781604051634c92543b60e01b81526004016101bc919061105e565b6102da81631859e3bb60e11b6106fb565b156102fa578160405163046cb69560e21b81526004016101bc919061105e565b6103038161072b565b50610380565b80516001600160a01b03163314801590610339575080602001516001600160a01b0316336001600160a01b031614155b1561035957604051632eaf165960e11b81523360048201526024016101bc565b80608001511561037e57816040516350943b5760e11b81526004016101bc919061105e565b505b6103c586868a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294939250506107379050565b838360028a8a6040516103d992919061118f565b908152604051908190036020019020916103f4919083611229565b50426002898960405161040892919061118f565b908152604051908190036020018120600101919091557f4caa3c04537f182db18e883a82444b9f9a8a6765fba869bb25cfa69694e7b8cf9061044d908a908a906112e9565b60405180910390a15050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806104a95750805467ffffffffffffffff808416911610155b156104c75760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556104f2846107cc565b600180546001600160a01b0319166001600160a01b038516179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6105686107f6565b6105718261089d565b61057b8282610903565b5050565b60006105896109c5565b5060008051602061138383398151915290565b6105a4610dc1565b82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600292506105eb915083906110e6565b90815260405190819003602001902060010154600003610620578060405163272a91e160e21b81526004016101bc919061105e565b6002848460405161063292919061118f565b908152602001604051809103902060405180604001604052908160008201805461065b9061119f565b80601f01602080910402602001604051908101604052809291908181526020018280546106879061119f565b80156106d45780601f106106a9576101008083540402835291602001916106d4565b820191906000526020600020905b8154815290600101906020018083116106b757829003601f168201915b50505091835250506040805160208082019092526001939093015483520152949350505050565b600080838060200190518101906107129190611318565b6001600160e01b03198481169116149150505b92915050565b60208101815182018082fd5b60008282604051806040016040528060158152602001742f616e6f6e63726564732f76302f534348454d412f60581b81525060405160200161077b93929190611342565b60405160208183030381529060405290506107a761079882610a0e565b6107a186610a0e565b90610a19565b6107c6578360405163ba33fe2160e01b81526004016101bc919061105e565b50505050565b6107d4610a2c565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061087d57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610871600080516020611383833981519152546001600160a01b031690565b6001600160a01b031614155b1561089b5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b1580156108e857600080fd5b505afa1580156108fc573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561095d575060408051601f3d908101601f1916820190925261095a91810190611369565b60015b61098557604051634c9c8ce360e01b81526001600160a01b03831660048201526024016101bc565b60008051602061138383398151915281146109b657604051632a87526960e21b8152600481018290526024016101bc565b6109c08383610a75565b505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461089b5760405163703e46dd60e11b815260040160405180910390fd5b600061072582610acb565b6000610a258383610adf565b9392505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661089b57604051631afcd79f60e31b815260040160405180910390fd5b610a7e82610b2c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610ac3576109c08282610b91565b61057b610c07565b600080602083019050610a25818451610c26565b60006001600160801b0383811690831680821015610b0257600092505050610725565b8481831115610b1857610b158683610c32565b90505b610b228186610c85565b9695505050505050565b806001600160a01b03163b600003610b6257604051634c9c8ce360e01b81526001600160a01b03821660048201526024016101bc565b60008051602061138383398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610bae91906110e6565b600060405180830381855af49150503d8060008114610be9576040519150601f19603f3d011682016040523d82523d6000602084013e610bee565b606091505b5091509150610bfe858383610cc7565b95945050505050565b341561089b5760405163b398979f60e01b815260040160405180910390fd5b6000610a258383610d23565b60006001600160801b03831680831115610c5f576040516365f4e9df60e01b815260040160405180910390fd5b610c7d610c6c8560801c90565b60801b6001600160801b0385161790565b949350505050565b60006001600160801b038381169083168114610ca5576000915050610725565b610c7d610cb28560801c90565b610cbc8560801c90565b839081902091201490565b606082610cdc57610cd782610d2f565b610a25565b8151158015610cf357506001600160a01b0384163b155b15610d1c57604051639996b31560e01b81526001600160a01b03851660048201526024016101bc565b5092915050565b6000610a258383610d5b565b805115610d3f5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b60006001600160801b03831115610d855760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b03821115610dad57604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b604051806040016040528060608152602001610de96040518060200160405280600081525090565b905290565b60008083601f840112610e0057600080fd5b50813567ffffffffffffffff811115610e1857600080fd5b602083019150836020828501011115610e3057600080fd5b9250929050565b60008060008060008060608789031215610e5057600080fd5b863567ffffffffffffffff80821115610e6857600080fd5b610e748a838b01610dee565b90985096506020890135915080821115610e8d57600080fd5b610e998a838b01610dee565b90965094506040890135915080821115610eb257600080fd5b50610ebf89828a01610dee565b979a9699509497509295939492505050565b6001600160a01b0381168114610d5857600080fd5b60008060408385031215610ef957600080fd5b8235610f0481610ed1565b91506020830135610f1481610ed1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610f5e57610f5e610f1f565b604052919050565b60008060408385031215610f7957600080fd5b8235610f8481610ed1565b915060208381013567ffffffffffffffff80821115610fa257600080fd5b818601915086601f830112610fb657600080fd5b813581811115610fc857610fc8610f1f565b610fda601f8201601f19168501610f35565b91508082528784828501011115610ff057600080fd5b80848401858401376000848284010152508093505050509250929050565b60005b83811015611029578181015183820152602001611011565b50506000910152565b6000815180845261104a81602086016020860161100e565b601f01601f19169290920160200192915050565b602081526000610a256020830184611032565b6000806020838503121561108457600080fd5b823567ffffffffffffffff81111561109b57600080fd5b6110a785828601610dee565b90969095509350505050565b6020815260008251604060208401526110cf6060840182611032565b905060208401515160408401528091505092915050565b600082516110f881846020870161100e565b9190910192915050565b600060a0828403121561111457600080fd5b60405160a0810181811067ffffffffffffffff8211171561113757611137610f1f565b604052825161114581610ed1565b8152602083015161115581610ed1565b8060208301525060408301516040820152606083015160608201526080830151801515811461118357600080fd5b60808201529392505050565b8183823760009101908152919050565b600181811c908216806111b357607f821691505b6020821081036111d357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156109c0576000816000526020600020601f850160051c810160208610156112025750805b601f850160051c820191505b818110156112215782815560010161120e565b505050505050565b67ffffffffffffffff83111561124157611241610f1f565b6112558361124f835461119f565b836111d9565b6000601f84116001811461128957600085156112715750838201355b600019600387901b1c1916600186901b1783556108fc565b600083815260209020601f19861690835b828110156112ba578685013582556020948501946001909201910161129a565b50868210156112d75760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561132a57600080fd5b81516001600160e01b031981168114610a2557600080fd5b82848237600083820160008152835161135f81836020880161100e565b0195945050505050565b60006020828403121561137b57600080fd5b505191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f9fb92c63284d98399ce8aebb03e50bca5549dbe7dcedfd1e7841b4f7c0e6d1464736f6c63430008170033" }, "0x0000000000000000000000000000000000004444": { "comment": "Proxy: Smart contract to manage credential definitions", @@ -230,13 +230,13 @@ "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000019999", "0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000000005555", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000c3afef8725f44662a4589e33d0d13a88c18a4756" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000801dd585c5bbb35909628880ecd8377d394bc50c" } }, - "0xc3afef8725f44662a4589e33d0d13a88c18a4756": { + "0x801dd585c5bbb35909628880ecd8377d394bc50c": { "comment": "Implementation: Smart contract to manage credential definitions", "balance": "0", - "code": "0x6080604052600436106100555760003560e01c80634cc562d41461005a5780634f1ef2861461007c57806352d1902d1461008f5780636170c48a146100b7578063ad3cb1cc146100e4578063c0c53b8b14610122575b600080fd5b34801561006657600080fd5b5061007a610075366004610f27565b610142565b005b61007a61008a3660046110b6565b610514565b34801561009b57600080fd5b506100a4610533565b6040519081526020015b60405180910390f35b3480156100c357600080fd5b506100d76100d2366004611148565b610550565b6040516100ae91906111d9565b3480156100f057600080fd5b50610115604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100ae919061120c565b34801561012e57600080fd5b5061007a61013d36600461121f565b6106af565b87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600392506101899150839061126a565b90815260405190819003602001902060010154156101c557806040516341d617b960e01b81526004016101bc919061120c565b60405180910390fd5b84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060025460405163bd7fc5eb60e01b81526001600160a01b03909116925063bd7fc5eb915061022b90849060040161120c565b6000604051808303816000875af115801561024a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102729190810190611286565b5087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506001546040516366874f2560e01b81526001600160a01b0390911692506366874f2591506102d990849060040161120c565b60a060405180830381865afa925050508015610312575060408051601f3d908101601f1916820190925261030f91810190611353565b60015b6103b7573d808015610340576040519150601f19603f3d011682016040523d82523d6000602084013e610345565b606091505b506103578163186a887560e11b6107c3565b156103775781604051634c92543b60e01b81526004016101bc919061120c565b61038881631859e3bb60e11b6107c3565b156103a8578160405163046cb69560e21b81526004016101bc919061120c565b6103b1816107f3565b5061042e565b80516001600160a01b031633148015906103e7575080602001516001600160a01b0316336001600160a01b031614155b1561040757604051633fcc3f1760e01b81523360048201526024016101bc565b80608001511561042c57816040516350943b5760e11b81526004016101bc919061120c565b505b610477898989898f8f8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092969594939250506107ff9050565b848460038d8d60405161048b9291906113df565b908152604051908190036020019020916104a6919083611471565b504260038c8c6040516104ba9291906113df565b908152604051908190036020018120600101919091557f4f0e13d45b6c20e62fb843b05270cf51d91c9cb535dbd5fe03abcc9bbd39d796906104ff908d908d90611530565b60405180910390a15050505050505050505050565b61051c6108bd565b61052582610964565b61052f82826109ca565b5050565b600061053d610a8c565b506000805160206115ea83398151915290565b610558610eb2565b82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516003925061059f9150839061126a565b908152604051908190036020019020600101546000036105d457806040516305c96b5360e01b81526004016101bc919061120c565b600384846040516105e69291906113df565b908152602001604051809103902060405180604001604052908160008201805461060f906113ef565b80601f016020809104026020016040519081016040528092919081815260200182805461063b906113ef565b80156106885780601f1061065d57610100808354040283529160200191610688565b820191906000526020600020905b81548152906001019060200180831161066b57829003601f168201915b50505091835250506040805160208082019092526001939093015483520152949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806106f8575080546001600160401b03808416911610155b156107165760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b17815561074085610ad5565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff0000000000000000191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b600080838060200190518101906107da919061155f565b6001600160e01b03198481169116149150505b92915050565b60208101815182018082fd5b600084846040518060400160405280601881526020017f2f616e6f6e63726564732f76302f434c41494d5f4445462f00000000000000008152508585604051806040016040528060018152602001602f60f81b81525060405160200161086a96959493929190611589565b604051602081830303815290604052905061089661088782610aff565b61089088610aff565b90610b0a565b6108b55785604051638ada824b60e01b81526004016101bc919061120c565b505050505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061094457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166109386000805160206115ea833981519152546001600160a01b031690565b6001600160a01b031614155b156109625760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b1580156109af57600080fd5b505afa1580156109c3573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610a24575060408051601f3d908101601f19168201909252610a21918101906115d0565b60015b610a4c57604051634c9c8ce360e01b81526001600160a01b03831660048201526024016101bc565b6000805160206115ea8339815191528114610a7d57604051632a87526960e21b8152600481018290526024016101bc565b610a878383610b1d565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109625760405163703e46dd60e11b815260040160405180910390fd5b610add610b73565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006107ed82610bbc565b6000610b168383610bd0565b9392505050565b610b2682610c1d565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610b6b57610a878282610c82565b61052f610cf8565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661096257604051631afcd79f60e31b815260040160405180910390fd5b600080602083019050610b16818451610d17565b60006001600160801b0383811690831680821015610bf3576000925050506107ed565b8481831115610c0957610c068683610d23565b90505b610c138186610d76565b9695505050505050565b806001600160a01b03163b600003610c5357604051634c9c8ce360e01b81526001600160a01b03821660048201526024016101bc565b6000805160206115ea83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610c9f919061126a565b600060405180830381855af49150503d8060008114610cda576040519150601f19603f3d011682016040523d82523d6000602084013e610cdf565b606091505b5091509150610cef858383610db8565b95945050505050565b34156109625760405163b398979f60e01b815260040160405180910390fd5b6000610b168383610e14565b60006001600160801b03831680831115610d50576040516365f4e9df60e01b815260040160405180910390fd5b610d6e610d5d8560801c90565b60801b6001600160801b0385161790565b949350505050565b60006001600160801b038381169083168114610d965760009150506107ed565b610d6e610da38560801c90565b610dad8560801c90565b839081902091201490565b606082610dcd57610dc882610e20565b610b16565b8151158015610de457506001600160a01b0384163b155b15610e0d57604051639996b31560e01b81526001600160a01b03851660048201526024016101bc565b5092915050565b6000610b168383610e4c565b805115610e305780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b60006001600160801b03831115610e765760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b03821115610e9e57604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b604051806040016040528060608152602001610eda6040518060200160405280600081525090565b905290565b60008083601f840112610ef157600080fd5b5081356001600160401b03811115610f0857600080fd5b602083019150836020828501011115610f2057600080fd5b9250929050565b6000806000806000806000806080898b031215610f4357600080fd5b88356001600160401b0380821115610f5a57600080fd5b610f668c838d01610edf565b909a50985060208b0135915080821115610f7f57600080fd5b610f8b8c838d01610edf565b909850965060408b0135915080821115610fa457600080fd5b610fb08c838d01610edf565b909650945060608b0135915080821115610fc957600080fd5b50610fd68b828c01610edf565b999c989b5096995094979396929594505050565b6001600160a01b0381168114610e4957600080fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561103757611037610fff565b60405290565b604051602081016001600160401b038111828210171561103757611037610fff565b604051601f8201601f191681016001600160401b038111828210171561108757611087610fff565b604052919050565b60006001600160401b038211156110a8576110a8610fff565b50601f01601f191660200190565b600080604083850312156110c957600080fd5b82356110d481610fea565b915060208301356001600160401b038111156110ef57600080fd5b8301601f8101851361110057600080fd5b803561111361110e8261108f565b61105f565b81815286602083850101111561112857600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000806020838503121561115b57600080fd5b82356001600160401b0381111561117157600080fd5b61117d85828601610edf565b90969095509350505050565b60005b838110156111a457818101518382015260200161118c565b50506000910152565b600081518084526111c5816020860160208601611189565b601f01601f19169290920160200192915050565b6020815260008251604060208401526111f560608401826111ad565b905060208401515160408401528091505092915050565b602081526000610b1660208301846111ad565b60008060006060848603121561123457600080fd5b833561123f81610fea565b9250602084013561124f81610fea565b9150604084013561125f81610fea565b809150509250925092565b6000825161127c818460208701611189565b9190910192915050565b6000602080838503121561129957600080fd5b82516001600160401b03808211156112b057600080fd5b9084019081860360408112156112c557600080fd5b6112cd611015565b8351838111156112dc57600080fd5b84019250601f830188136112ef57600080fd5b82516112fd61110e8261108f565b818152898783870101111561131157600080fd5b61132082888301898801611189565b825250601f19820185131561133457600080fd5b61133c61103d565b938501518452938401929092525090949350505050565b600060a0828403121561136557600080fd5b60405160a081018181106001600160401b038211171561138757611387610fff565b604052825161139581610fea565b815260208301516113a581610fea565b806020830152506040830151604082015260608301516060820152608083015180151581146113d357600080fd5b60808201529392505050565b8183823760009101908152919050565b600181811c9082168061140357607f821691505b60208210810361142357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610a87576000816000526020600020601f850160051c810160208610156114525750805b601f850160051c820191505b818110156108b55782815560010161145e565b6001600160401b0383111561148857611488610fff565b61149c8361149683546113ef565b83611429565b6000601f8411600181146114d057600085156114b85750838201355b600019600387901b1c1916600186901b1783556109c3565b600083815260209020601f19861690835b8281101561150157868501358255602094850194600190920191016114e1565b508682101561151e5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561157157600080fd5b81516001600160e01b031981168114610b1657600080fd5b8587823760008682016000815286516115a6818360208b01611189565b0184868237600090850190815283516115c3818360208801611189565b0198975050505050505050565b6000602082840312156115e257600080fd5b505191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209bb751a24a6453497c874c242fd2e90fc4c30f4f36b1db84b22749efca339e2b64736f6c63430008170033" + "code": "0x6080604052600436106100555760003560e01c80634cc562d41461005a5780634f1ef2861461007c57806352d1902d1461008f5780636170c48a146100b7578063ad3cb1cc146100e4578063c0c53b8b14610122575b600080fd5b34801561006657600080fd5b5061007a610075366004610f27565b610142565b005b61007a61008a3660046110b6565b610514565b34801561009b57600080fd5b506100a4610533565b6040519081526020015b60405180910390f35b3480156100c357600080fd5b506100d76100d2366004611148565b610550565b6040516100ae91906111d9565b3480156100f057600080fd5b50610115604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100ae919061120c565b34801561012e57600080fd5b5061007a61013d36600461121f565b6106af565b87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600392506101899150839061126a565b90815260405190819003602001902060010154156101c557806040516341d617b960e01b81526004016101bc919061120c565b60405180910390fd5b84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060025460405163bd7fc5eb60e01b81526001600160a01b03909116925063bd7fc5eb915061022b90849060040161120c565b6000604051808303816000875af115801561024a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102729190810190611286565b5087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506001546040516366874f2560e01b81526001600160a01b0390911692506366874f2591506102d990849060040161120c565b60a060405180830381865afa925050508015610312575060408051601f3d908101601f1916820190925261030f91810190611353565b60015b6103b7573d808015610340576040519150601f19603f3d011682016040523d82523d6000602084013e610345565b606091505b506103578163186a887560e11b6107c3565b156103775781604051634c92543b60e01b81526004016101bc919061120c565b61038881631859e3bb60e11b6107c3565b156103a8578160405163046cb69560e21b81526004016101bc919061120c565b6103b1816107f3565b5061042e565b80516001600160a01b031633148015906103e7575080602001516001600160a01b0316336001600160a01b031614155b1561040757604051632eaf165960e11b81523360048201526024016101bc565b80608001511561042c57816040516350943b5760e11b81526004016101bc919061120c565b505b610477898989898f8f8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092969594939250506107ff9050565b848460038d8d60405161048b9291906113df565b908152604051908190036020019020916104a6919083611471565b504260038c8c6040516104ba9291906113df565b908152604051908190036020018120600101919091557f4f0e13d45b6c20e62fb843b05270cf51d91c9cb535dbd5fe03abcc9bbd39d796906104ff908d908d90611530565b60405180910390a15050505050505050505050565b61051c6108bd565b61052582610964565b61052f82826109ca565b5050565b600061053d610a8c565b506000805160206115ea83398151915290565b610558610eb2565b82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516003925061059f9150839061126a565b908152604051908190036020019020600101546000036105d457806040516305c96b5360e01b81526004016101bc919061120c565b600384846040516105e69291906113df565b908152602001604051809103902060405180604001604052908160008201805461060f906113ef565b80601f016020809104026020016040519081016040528092919081815260200182805461063b906113ef565b80156106885780601f1061065d57610100808354040283529160200191610688565b820191906000526020600020905b81548152906001019060200180831161066b57829003601f168201915b50505091835250506040805160208082019092526001939093015483520152949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806106f8575080546001600160401b03808416911610155b156107165760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b17815561074085610ad5565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff0000000000000000191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b600080838060200190518101906107da919061155f565b6001600160e01b03198481169116149150505b92915050565b60208101815182018082fd5b600084846040518060400160405280601881526020017f2f616e6f6e63726564732f76302f434c41494d5f4445462f00000000000000008152508585604051806040016040528060018152602001602f60f81b81525060405160200161086a96959493929190611589565b604051602081830303815290604052905061089661088782610aff565b61089088610aff565b90610b0a565b6108b55785604051638ada824b60e01b81526004016101bc919061120c565b505050505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061094457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166109386000805160206115ea833981519152546001600160a01b031690565b6001600160a01b031614155b156109625760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b1580156109af57600080fd5b505afa1580156109c3573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610a24575060408051601f3d908101601f19168201909252610a21918101906115d0565b60015b610a4c57604051634c9c8ce360e01b81526001600160a01b03831660048201526024016101bc565b6000805160206115ea8339815191528114610a7d57604051632a87526960e21b8152600481018290526024016101bc565b610a878383610b1d565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109625760405163703e46dd60e11b815260040160405180910390fd5b610add610b73565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006107ed82610bbc565b6000610b168383610bd0565b9392505050565b610b2682610c1d565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610b6b57610a878282610c82565b61052f610cf8565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661096257604051631afcd79f60e31b815260040160405180910390fd5b600080602083019050610b16818451610d17565b60006001600160801b0383811690831680821015610bf3576000925050506107ed565b8481831115610c0957610c068683610d23565b90505b610c138186610d76565b9695505050505050565b806001600160a01b03163b600003610c5357604051634c9c8ce360e01b81526001600160a01b03821660048201526024016101bc565b6000805160206115ea83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610c9f919061126a565b600060405180830381855af49150503d8060008114610cda576040519150601f19603f3d011682016040523d82523d6000602084013e610cdf565b606091505b5091509150610cef858383610db8565b95945050505050565b34156109625760405163b398979f60e01b815260040160405180910390fd5b6000610b168383610e14565b60006001600160801b03831680831115610d50576040516365f4e9df60e01b815260040160405180910390fd5b610d6e610d5d8560801c90565b60801b6001600160801b0385161790565b949350505050565b60006001600160801b038381169083168114610d965760009150506107ed565b610d6e610da38560801c90565b610dad8560801c90565b839081902091201490565b606082610dcd57610dc882610e20565b610b16565b8151158015610de457506001600160a01b0384163b155b15610e0d57604051639996b31560e01b81526001600160a01b03851660048201526024016101bc565b5092915050565b6000610b168383610e4c565b805115610e305780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b60006001600160801b03831115610e765760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b03821115610e9e57604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b604051806040016040528060608152602001610eda6040518060200160405280600081525090565b905290565b60008083601f840112610ef157600080fd5b5081356001600160401b03811115610f0857600080fd5b602083019150836020828501011115610f2057600080fd5b9250929050565b6000806000806000806000806080898b031215610f4357600080fd5b88356001600160401b0380821115610f5a57600080fd5b610f668c838d01610edf565b909a50985060208b0135915080821115610f7f57600080fd5b610f8b8c838d01610edf565b909850965060408b0135915080821115610fa457600080fd5b610fb08c838d01610edf565b909650945060608b0135915080821115610fc957600080fd5b50610fd68b828c01610edf565b999c989b5096995094979396929594505050565b6001600160a01b0381168114610e4957600080fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561103757611037610fff565b60405290565b604051602081016001600160401b038111828210171561103757611037610fff565b604051601f8201601f191681016001600160401b038111828210171561108757611087610fff565b604052919050565b60006001600160401b038211156110a8576110a8610fff565b50601f01601f191660200190565b600080604083850312156110c957600080fd5b82356110d481610fea565b915060208301356001600160401b038111156110ef57600080fd5b8301601f8101851361110057600080fd5b803561111361110e8261108f565b61105f565b81815286602083850101111561112857600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000806020838503121561115b57600080fd5b82356001600160401b0381111561117157600080fd5b61117d85828601610edf565b90969095509350505050565b60005b838110156111a457818101518382015260200161118c565b50506000910152565b600081518084526111c5816020860160208601611189565b601f01601f19169290920160200192915050565b6020815260008251604060208401526111f560608401826111ad565b905060208401515160408401528091505092915050565b602081526000610b1660208301846111ad565b60008060006060848603121561123457600080fd5b833561123f81610fea565b9250602084013561124f81610fea565b9150604084013561125f81610fea565b809150509250925092565b6000825161127c818460208701611189565b9190910192915050565b6000602080838503121561129957600080fd5b82516001600160401b03808211156112b057600080fd5b9084019081860360408112156112c557600080fd5b6112cd611015565b8351838111156112dc57600080fd5b84019250601f830188136112ef57600080fd5b82516112fd61110e8261108f565b818152898783870101111561131157600080fd5b61132082888301898801611189565b825250601f19820185131561133457600080fd5b61133c61103d565b938501518452938401929092525090949350505050565b600060a0828403121561136557600080fd5b60405160a081018181106001600160401b038211171561138757611387610fff565b604052825161139581610fea565b815260208301516113a581610fea565b806020830152506040830151604082015260608301516060820152608083015180151581146113d357600080fd5b60808201529392505050565b8183823760009101908152919050565b600181811c9082168061140357607f821691505b60208210810361142357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610a87576000816000526020600020601f850160051c810160208610156114525750805b601f850160051c820191505b818110156108b55782815560010161145e565b6001600160401b0383111561148857611488610fff565b61149c8361149683546113ef565b83611429565b6000601f8411600181146114d057600085156114b85750838201355b600019600387901b1c1916600186901b1783556109c3565b600083815260209020601f19861690835b8281101561150157868501358255602094850194600190920191016114e1565b508682101561151e5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561157157600080fd5b81516001600160e01b031981168114610b1657600080fd5b8587823760008682016000815286516115a6818360208b01611189565b0184868237600090850190815283516115c3818360208801611189565b0198975050505050505050565b6000602082840312156115e257600080fd5b505191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212204caf3e3cfe98f51602c4e038187aeaa396c1f38eb2b51cfc73b9a10b30f3494364736f6c63430008170033" } } } diff --git a/indy-besu/network/config/nodes/validator5/key b/indy-besu/network/config/nodes/validator5/key index e453afb69..9e35282c5 100644 --- a/indy-besu/network/config/nodes/validator5/key +++ b/indy-besu/network/config/nodes/validator5/key @@ -1 +1 @@ -0xa4980ba8c2dfe3c4011c942dda9b9a71bca04021a3a54f48ba3e993a52646701 \ No newline at end of file +0xd0cf616a964ed015cd74da1f45425b73285787b3a106f4c7dcb3f85abe40d612 \ No newline at end of file diff --git a/indy-besu/vdr/Cargo.lock b/indy-besu/vdr/Cargo.lock index 276ccfd54..1bce80c94 100644 --- a/indy-besu/vdr/Cargo.lock +++ b/indy-besu/vdr/Cargo.lock @@ -183,6 +183,18 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "auto_impl" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -204,6 +216,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.13.1" @@ -216,6 +234,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "bitflags" version = "1.3.2" @@ -306,6 +330,9 @@ name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] [[package]] name = "cc" @@ -345,6 +372,25 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "const-hex" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "convert_case" version = "0.4.0" @@ -391,6 +437,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -401,6 +459,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -430,7 +498,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", + "subtle", ] [[package]] @@ -439,12 +509,45 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + [[package]] name = "either" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "encoding_rs" version = "0.8.33" @@ -549,6 +652,33 @@ dependencies = [ "uint", ] +[[package]] +name = "ethers-core" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918b1a9ba585ea61022647def2f27c29ba19f6d2a4a4c8f68a9ae97fd5769737" +dependencies = [ + "arrayvec", + "bytes", + "chrono", + "const-hex", + "elliptic-curve", + "ethabi", + "generic-array", + "k256", + "num_enum", + "open-fastrlp", + "rand", + "rlp", + "serde", + "serde_json", + "strum", + "tempfile", + "thiserror", + "tiny-keccak", + "unicode-xid", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -570,6 +700,16 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -746,6 +886,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -779,6 +920,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "h2" version = "0.3.24" @@ -843,6 +995,12 @@ dependencies = [ "http", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hermit-abi" version = "0.3.3" @@ -855,6 +1013,15 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "http" version = "0.2.11" @@ -1036,6 +1203,7 @@ dependencies = [ "ethabi", "ethereum", "ethereum-types", + "ethers-core", "futures", "hex", "log", @@ -1046,6 +1214,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "sha3", "thiserror", "web-sys", "web3", @@ -1127,6 +1296,19 @@ dependencies = [ "serde_json", ] +[[package]] +name = "k256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", +] + [[package]] name = "keccak" version = "0.1.4" @@ -1157,6 +1339,12 @@ version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -1272,6 +1460,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1284,6 +1473,27 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "object" version = "0.32.1" @@ -1305,6 +1515,31 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "open-fastrlp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", + "ethereum-types", + "open-fastrlp-derive", +] + +[[package]] +name = "open-fastrlp-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" +dependencies = [ + "bytes", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "openssl" version = "0.10.62" @@ -1453,6 +1688,16 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.29" @@ -1532,6 +1777,30 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.67" @@ -1541,6 +1810,22 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proptest" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +dependencies = [ + "bitflags 2.4.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.2", + "unarray", +] + [[package]] name = "quote" version = "1.0.33" @@ -1586,6 +1871,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -1604,7 +1898,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax", + "regex-syntax 0.7.5", ] [[package]] @@ -1615,7 +1909,7 @@ checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.7.5", ] [[package]] @@ -1624,6 +1918,12 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + [[package]] name = "reqwest" version = "0.11.23" @@ -1662,6 +1962,16 @@ dependencies = [ "winreg", ] +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + [[package]] name = "rlp" version = "0.5.2" @@ -1732,6 +2042,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" version = "1.0.15" @@ -1778,6 +2094,20 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + [[package]] name = "secp256k1" version = "0.27.0" @@ -1928,6 +2258,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha3" version = "0.10.8" @@ -1947,6 +2288,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core", +] + [[package]] name = "slab" version = "0.4.9" @@ -1997,12 +2348,50 @@ dependencies = [ "sha-1", ] +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.37", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "syn" version = "1.0.109" @@ -2266,6 +2655,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -2287,6 +2682,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "url" version = "2.5.0" @@ -2666,3 +3067,9 @@ checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ "tap", ] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/indy-besu/vdr/Cargo.toml b/indy-besu/vdr/Cargo.toml index 307ea0764..95f4221cf 100644 --- a/indy-besu/vdr/Cargo.toml +++ b/indy-besu/vdr/Cargo.toml @@ -29,11 +29,13 @@ chrono = "0.4.32" ethereum = "0.15.0" ethereum-types = "0.14.1" ethabi = "18.0.0" +ethers-core = "2.0.12" hex = "0.4.3" futures = "0.3.28" once_cell = "1.18.0" rand = { version = "0.8.5", optional = true } secp256k1 = { version = "0.28.0", optional = true, features = ["recovery", "rand"] } +sha3 = "0.10.8" serde = "1.0.188" serde_derive = "1.0.188" serde_json = "1.0.107" diff --git a/indy-besu/vdr/src/client/client.rs b/indy-besu/vdr/src/client/client.rs index 9c64918db..50c3fe494 100644 --- a/indy-besu/vdr/src/client/client.rs +++ b/indy-besu/vdr/src/client/client.rs @@ -150,12 +150,12 @@ impl LedgerClient { /// /// # Returns /// number of sent transaction - pub(crate) async fn get_transaction_count(&self, address: &Address) -> VdrResult> { + pub(crate) async fn get_transaction_count(&self, address: &Address) -> VdrResult { trace!( "LedgerClient::get_transaction_count >>> address: {:?}", address ); - let count = self.client.get_transaction_count(address).await?.to_vec(); + let count = self.client.get_transaction_count(address).await?; trace!("LedgerClient::get_transaction_count >>> count: {:?}", count); Ok(count) } @@ -239,7 +239,7 @@ pub mod test { "http://127.0.0.1:21003", "http://127.0.0.1:21004", ]; - pub static DEFAULT_NONCE: Lazy> = Lazy::new(|| vec![0, 0, 0, 0]); + pub const DEFAULT_NONCE: u64 = 0; pub static DID_REGISTRY_ADDRESS: Lazy
= Lazy::new(|| Address::from("0x0000000000000000000000000000000000003333")); @@ -319,8 +319,8 @@ pub mod test { #[async_trait] impl Client for MockClient { - async fn get_transaction_count(&self, _address: &Address) -> VdrResult<[u64; 4]> { - Ok([0, 0, 0, 0]) + async fn get_transaction_count(&self, _address: &Address) -> VdrResult { + Ok(0) } async fn submit_transaction(&self, _transaction: &[u8]) -> VdrResult> { diff --git a/indy-besu/vdr/src/client/implementation/web3/client.rs b/indy-besu/vdr/src/client/implementation/web3/client.rs index d0d312806..296ef26e3 100644 --- a/indy-besu/vdr/src/client/implementation/web3/client.rs +++ b/indy-besu/vdr/src/client/implementation/web3/client.rs @@ -59,7 +59,7 @@ impl Web3Client { #[cfg_attr(not(feature = "wasm"), async_trait)] #[cfg_attr(feature = "wasm", async_trait(? Send))] impl Client for Web3Client { - async fn get_transaction_count(&self, address: &Address) -> VdrResult<[u64; 4]> { + async fn get_transaction_count(&self, address: &Address) -> VdrResult { trace!( "Web3Client::get_transaction_count >>> address: {:?}", address @@ -77,7 +77,7 @@ impl Client for Web3Client { .eth() .transaction_count(account_address, None) .await? - .0; + .as_u64(); trace!("Web3Client::get_transaction_count <<< count: {:?}", count); Ok(count) @@ -267,7 +267,7 @@ impl Client for Web3Client { .to .map(|from| Address::from(from.to_string().as_str())) .unwrap_or_default(), - nonce: Some(transaction.nonce.0.to_vec()), + nonce: Some(transaction.nonce.as_u64()), chain_id: 0, data: transaction.input.0.to_vec(), signature: Default::default(), diff --git a/indy-besu/vdr/src/client/implementation/web3/contract.rs b/indy-besu/vdr/src/client/implementation/web3/contract.rs index 86bff69e6..82935f052 100644 --- a/indy-besu/vdr/src/client/implementation/web3/contract.rs +++ b/indy-besu/vdr/src/client/implementation/web3/contract.rs @@ -18,7 +18,7 @@ use web3::{ #[cfg(feature = "wasm")] use web3_wasm::{ contract::Contract as Web3ContractImpl, - ethabi::{Address as EthAddress, Function, Token}, + ethabi::{Address as EthAddress, Function}, transports::Http, }; diff --git a/indy-besu/vdr/src/client/mod.rs b/indy-besu/vdr/src/client/mod.rs index 5baabc91d..1f7143a03 100644 --- a/indy-besu/vdr/src/client/mod.rs +++ b/indy-besu/vdr/src/client/mod.rs @@ -30,7 +30,7 @@ pub trait Client: Sync + Send { /// /// # Returns /// number of transactions - async fn get_transaction_count(&self, address: &Address) -> VdrResult<[u64; 4]>; + async fn get_transaction_count(&self, address: &Address) -> VdrResult; /// Submit transaction to the ledger /// diff --git a/indy-besu/vdr/src/contracts/did/did_ethr_registry.rs b/indy-besu/vdr/src/contracts/did/did_ethr_registry.rs index 69031a56a..18383e81b 100644 --- a/indy-besu/vdr/src/contracts/did/did_ethr_registry.rs +++ b/indy-besu/vdr/src/contracts/did/did_ethr_registry.rs @@ -15,10 +15,12 @@ use crate::{ }, error::VdrResult, types::{ - Address, Block, EventLog, EventParser, EventQuery, EventQueryBuilder, Transaction, - TransactionBuilder, TransactionParser, TransactionType, + Address, EventLog, EventParser, EventQuery, EventQueryBuilder, MethodParam, Transaction, + TransactionBuilder, TransactionEndorsingDataBuilder, TransactionParser, TransactionType, + UintBytesParam, }, - DidDocumentBuilder, SignatureData, VdrError, VerificationKeyType, DID, + Block, DidDocumentBuilder, SignatureData, TransactionEndorsingData, VdrError, + VerificationKeyType, DID, }; const CONTRACT_NAME: &str = "EthereumExtDidRegistry"; @@ -62,8 +64,8 @@ pub async fn build_did_change_owner_transaction( new_owner: &Address, ) -> VdrResult { debug!( - "{} txn build has started. Sender: {:?}, did: {:?}, new_owner: {:?}", - METHOD_CHANGE_OWNER, sender, did, new_owner + "EthereumExtDidRegistry::build_did_change_owner_transaction >>> sender: {:?}, did: {:?}, new_owner: {:?}", + sender, did, new_owner ); let identity = Address::try_from(did)?; @@ -78,13 +80,50 @@ pub async fn build_did_change_owner_transaction( .await; info!( - "{} txn build has finished. Result: {:?}", - METHOD_CHANGE_OWNER, transaction + "EthereumExtDidRegistry::build_did_change_owner_transaction <<< transaction: {:?}", + transaction ); transaction } +/// Prepared data for endorsing EthereumExtDidRegistry.changeOwner contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to change ownership +/// - `new_owner` account address of new owner +/// +/// #Returns +/// data: TransactionEndorsingData - transaction endorsement data to sign +pub async fn build_did_change_owner_endorsing_data( + client: &LedgerClient, + did: &DID, + new_owner: &Address, +) -> VdrResult { + debug!( + "EthereumExtDidRegistry::build_did_change_owner_endorsing_data >>> did: {:?}, new_owner: {:?}", + did, new_owner + ); + + let identity = Address::try_from(did)?; + let data = TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param((&identity).try_into()?) + .add_param(MethodParam::from(METHOD_CHANGE_OWNER).into()) + .add_param(new_owner.try_into()?) + .build(client) + .await?; + + info!( + "EthereumExtDidRegistry::build_did_change_owner_endorsing_data <<< data: {:?}", + data + ); + + Ok(data) +} + /// Build transaction to execute EthereumExtDidRegistry.changeOwnerSigned contract method to /// change the owner of ether DID /// Endorsing version of the method - sender is not identity owner @@ -99,13 +138,37 @@ pub async fn build_did_change_owner_transaction( /// #Returns /// transaction: Transaction - prepared write transaction object to sign and submit pub async fn build_did_change_owner_signed_transaction( - _client: &LedgerClient, - _sender: &Address, - _did: &DID, - _new_owner: &Address, - _signature: &SignatureData, + client: &LedgerClient, + sender: &Address, + did: &DID, + new_owner: &Address, + signature: &SignatureData, ) -> VdrResult { - unimplemented!() + debug!( + "EthereumExtDidRegistry::build_did_change_owner_signed_transaction >>> sender: {:?}, did: {:?}, new_owner: {:?}", + sender, did, new_owner + ); + + let identity = Address::try_from(did)?; + let transaction = TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_CHANGE_OWNER_SIGNED) + .add_param((&identity).try_into()?) + .add_param(signature.v().into()) + .add_param(signature.r().into()) + .add_param(signature.s().into()) + .add_param(new_owner.try_into()?) + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await; + + info!( + "EthereumExtDidRegistry::build_did_change_owner_signed_transaction <<< transaction: {:?}", + transaction + ); + + transaction } /// Build transaction to execute EthereumExtDidRegistry.addDelegate contract method to add a delegate. @@ -127,11 +190,11 @@ pub async fn build_did_add_delegate_transaction( did: &DID, delegate_type: &DelegateType, delegate: &Address, - validity: Option, + validity: &Validity, ) -> VdrResult { debug!( - "{} txn build has started. Sender: {:?}, did: {:?}, delegate_type: {:?}, delegate: {:?}, validity: {:?}", - METHOD_ADD_DELEGATE, sender, did, delegate_type, delegate, validity + "EthereumExtDidRegistry::build_did_add_delegate_transaction >>> sender: {:?}, did: {:?}, delegate_type: {:?}, delegate: {:?}, validity: {:?}", + sender, did, delegate_type, delegate, validity ); let identity = Address::try_from(did)?; @@ -141,18 +204,61 @@ pub async fn build_did_add_delegate_transaction( .add_param((&identity).try_into()?) .add_param(delegate_type.try_into()?) .add_param(delegate.try_into()?) - .add_param((&validity.unwrap_or_default()).into()) + .add_param(validity.into()) .set_type(TransactionType::Write) .set_from(sender) .build(client) - .await; + .await?; info!( - "{} txn build has finished. Result: {:?}", - METHOD_ADD_DELEGATE, transaction + "EthereumExtDidRegistry::build_did_add_delegate_transaction <<< transaction: {:?}", + transaction ); - transaction + Ok(transaction) +} + +/// Prepared data for endorsing EthereumExtDidRegistry.addDelegate contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// - `validity` delegate validity time +/// +/// #Returns +/// data: TransactionEndorsingData - transaction endorsement data to sign +pub async fn build_did_add_delegate_endorsing_data( + client: &LedgerClient, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + validity: &Validity, +) -> VdrResult { + debug!( + "EthereumExtDidRegistry::build_did_add_delegate_endorsing_data >>> did: {:?}, delegate_type: {:?}, delegate: {:?}, validity: {:?}", + did, delegate_type, delegate, validity + ); + + let identity = Address::try_from(did)?; + let data = TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param((&identity).try_into()?) + .add_param(MethodParam::from(METHOD_ADD_DELEGATE).into()) + .add_param(delegate_type.try_into()?) + .add_param(delegate.try_into()?) + .add_param(UintBytesParam::from(validity.0).try_into()?) + .build(client) + .await?; + + info!( + "EthereumExtDidRegistry::build_did_add_delegate_endorsing_data <<< data: {:?}", + data + ); + + Ok(data) } /// Build transaction to execute EthereumExtDidRegistry.addDelegateSigned contract method to add a delegate. @@ -172,15 +278,41 @@ pub async fn build_did_add_delegate_transaction( /// #Returns /// transaction: Transaction - prepared write transaction object to sign and submit pub async fn build_did_add_delegate_signed_transaction( - _client: &LedgerClient, - _sender: &Address, - _did: &DID, - _delegate_type: &DelegateType, - _delegate: &Address, - _validity: Option, - _signature: &SignatureData, + client: &LedgerClient, + sender: &Address, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + validity: &Validity, + signature: &SignatureData, ) -> VdrResult { - unimplemented!() + debug!( + "EthereumExtDidRegistry::build_did_add_delegate_signed_transaction >>> sender: {:?}, did: {:?}, delegate_type: {:?}, delegate: {:?}, validity: {:?}", + sender, did, delegate_type, delegate, validity + ); + + let identity = Address::try_from(did)?; + let transaction = TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_ADD_DELEGATE_SIGNED) + .add_param((&identity).try_into()?) + .add_param(signature.v().into()) + .add_param(signature.r().into()) + .add_param(signature.s().into()) + .add_param(delegate_type.try_into()?) + .add_param(delegate.try_into()?) + .add_param(validity.into()) + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await?; + + info!( + "EthereumExtDidRegistry::build_did_add_delegate_signed_transaction <<< transaction: {:?}", + transaction + ); + + Ok(transaction) } /// Build transaction to execute EthereumExtDidRegistry.revokeDelegate contract method to revoke a delegate. @@ -203,8 +335,8 @@ pub async fn build_did_revoke_delegate_transaction( delegate: &Address, ) -> VdrResult { debug!( - "{} txn build has started. Sender: {:?}, did: {:?}, delegate_type: {:?}, delegate: {:?}", - METHOD_REVOKE_DELEGATE, sender, did, delegate_type, delegate + "EthereumExtDidRegistry::build_did_revoke_delegate_transaction >>> sender: {:?}, did: {:?}, delegate_type: {:?}, delegate: {:?}", + sender, did, delegate_type, delegate ); let identity = Address::try_from(did)?; @@ -217,14 +349,54 @@ pub async fn build_did_revoke_delegate_transaction( .set_type(TransactionType::Write) .set_from(sender) .build(client) - .await; + .await?; info!( - "{} txn build has finished. Result: {:?}", - METHOD_REVOKE_DELEGATE, transaction + "EthereumExtDidRegistry::build_did_revoke_delegate_transaction <<< transaction: {:?}", + transaction ); - transaction + Ok(transaction) +} + +/// Prepared data for endorsing EthereumExtDidRegistry.revokeDelegate contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// +/// #Returns +/// data: TransactionEndorsingData - transaction endorsement data to sign +pub async fn build_did_revoke_delegate_endorsing_data( + client: &LedgerClient, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, +) -> VdrResult { + debug!( + "EthereumExtDidRegistry::build_did_revoke_delegate_endorsing_data >>> did: {:?}, delegate_type: {:?}, delegate: {:?}", + did, delegate_type, delegate + ); + + let identity = Address::try_from(did)?; + let data = TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param((&identity).try_into()?) + .add_param(MethodParam::from(METHOD_REVOKE_DELEGATE).into()) + .add_param(delegate_type.try_into()?) + .add_param(delegate.try_into()?) + .build(client) + .await?; + + info!( + "EthereumExtDidRegistry::build_did_revoke_delegate_endorsing_data <<< data: {:?}", + data + ); + + Ok(data) } /// Build transaction to execute EthereumExtDidRegistry.revokeDelegateSigned contract method to revoke a delegate. @@ -243,14 +415,39 @@ pub async fn build_did_revoke_delegate_transaction( /// #Returns /// transaction: Transaction - prepared write transaction object to sign and submit pub async fn build_did_revoke_delegate_signed_transaction( - _client: &LedgerClient, - _sender: &Address, - _did: &DID, - _delegate_type: &DelegateType, - _delegate: &Address, - _signature: &SignatureData, + client: &LedgerClient, + sender: &Address, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + signature: &SignatureData, ) -> VdrResult { - unimplemented!() + debug!( + "EthereumExtDidRegistry::build_did_revoke_delegate_signed_transaction >>> sender: {:?}, did: {:?}, delegate_type: {:?}, delegate: {:?}", + sender, did, delegate_type, delegate + ); + + let identity = Address::try_from(did)?; + let transaction = TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_REVOKE_DELEGATE_SIGNED) + .add_param((&identity).try_into()?) + .add_param(signature.v().into()) + .add_param(signature.r().into()) + .add_param(signature.s().into()) + .add_param(delegate_type.try_into()?) + .add_param(delegate.try_into()?) + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await?; + + info!( + "EthereumExtDidRegistry::build_did_revoke_delegate_signed_transaction <<< transaction: {:?}", + transaction + ); + + Ok(transaction) } /// Build transaction to execute EthereumExtDidRegistry.setAttribute contract method to add @@ -272,11 +469,11 @@ pub async fn build_did_set_attribute_transaction( sender: &Address, did: &DID, attribute: &DidDocAttribute, - validity: Option, + validity: &Validity, ) -> VdrResult { debug!( - "{} txn build has started. Sender: {:?}, attribute: {:?}", - METHOD_SET_ATTRIBUTE, sender, attribute + "EthereumExtDidRegistry::build_did_set_attribute_transaction >>> sender: {:?}, did: {:?}, attribute: {:?}, validity: {:?}", + sender, did, attribute, validity ); let identity = Address::try_from(did)?; @@ -286,18 +483,59 @@ pub async fn build_did_set_attribute_transaction( .add_param((&identity).try_into()?) .add_param((&attribute.name()?).try_into()?) .add_param((&attribute.value()?).into()) - .add_param((&validity.unwrap_or_default()).into()) + .add_param(validity.into()) .set_type(TransactionType::Write) .set_from(sender) .build(client) - .await; + .await?; info!( - "{} txn build has finished. Result: {:?}", - METHOD_SET_ATTRIBUTE, transaction + "EthereumExtDidRegistry::build_did_set_attribute_transaction <<< transaction: {:?}", + transaction ); - transaction + Ok(transaction) +} + +/// Prepared data for endorsing EthereumExtDidRegistry.setAttribute contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add an attribute +/// - `attribute` attribute to add +/// - `validity` attribute validity time +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_set_attribute_endorsing_data( + client: &LedgerClient, + did: &DID, + attribute: &DidDocAttribute, + validity: &Validity, +) -> VdrResult { + debug!( + "EthereumExtDidRegistry::build_did_set_attribute_endorsing_data >>> did: {:?}, attribute: {:?}, validity: {:?}", + did, attribute, validity + ); + + let identity = Address::try_from(did)?; + let bytes = TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param((&identity).try_into()?) + .add_param(MethodParam::from(METHOD_SET_ATTRIBUTE).into()) + .add_param((&attribute.name()?).try_into()?) + .add_param((&attribute.value()?).into()) + .add_param(UintBytesParam::from(validity.0).try_into()?) + .build(client) + .await?; + + info!( + "EthereumExtDidRegistry::build_did_set_attribute_endorsing_data <<< bytes: {:?}", + bytes + ); + + Ok(bytes) } /// Build transaction to execute EthereumExtDidRegistry.setAttributeSigned contract method to add @@ -318,14 +556,40 @@ pub async fn build_did_set_attribute_transaction( /// #Returns /// transaction: Transaction - prepared write transaction object to sign and submit pub async fn build_did_set_attribute_signed_transaction( - _client: &LedgerClient, - _sender: &Address, - _did: &DID, - _attribute: &DidDocAttribute, - _validity: Option, - _signature: &SignatureData, + client: &LedgerClient, + sender: &Address, + did: &DID, + attribute: &DidDocAttribute, + validity: &Validity, + signature: &SignatureData, ) -> VdrResult { - unimplemented!() + debug!( + "EthereumExtDidRegistry::build_did_set_attribute_signed_transaction >>> did: {:?}, attribute: {:?}, validity: {:?}", + did, attribute, validity + ); + + let identity = Address::try_from(did)?; + let transaction = TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_SET_ATTRIBUTE_SIGNED) + .add_param((&identity).try_into()?) + .add_param(signature.v().into()) + .add_param(signature.r().into()) + .add_param(signature.s().into()) + .add_param((&attribute.name()?).try_into()?) + .add_param((&attribute.value()?).into()) + .add_param(validity.into()) + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await?; + + info!( + "EthereumExtDidRegistry::build_did_set_attribute_signed_transaction <<< transaction: {:?}", + transaction + ); + + Ok(transaction) } /// Build transaction to execute EthereumExtDidRegistry.revokeAttribute contract method to revoke @@ -348,8 +612,8 @@ pub async fn build_did_revoke_attribute_transaction( attribute: &DidDocAttribute, ) -> VdrResult { debug!( - "{} txn build has started. Sender: {:?}, attribute: {:?}", - METHOD_REVOKE_ATTRIBUTE, sender, attribute + "EthereumExtDidRegistry::build_did_revoke_attribute_transaction >>> did: {:?}, attribute: {:?}", + did, attribute ); let identity = Address::try_from(did)?; @@ -362,14 +626,52 @@ pub async fn build_did_revoke_attribute_transaction( .set_type(TransactionType::Write) .set_from(sender) .build(client) - .await; + .await?; info!( - "{} txn build has finished. Result: {:?}", - METHOD_REVOKE_ATTRIBUTE, transaction + "EthereumExtDidRegistry::build_did_revoke_attribute_transaction <<< transaction: {:?}", + transaction ); - transaction + Ok(transaction) +} + +/// Prepared data for endorsing EthereumExtDidRegistry.revokeAttribute contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add an attribute +/// - `attribute` attribute to add +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_revoke_attribute_endorsing_data( + client: &LedgerClient, + did: &DID, + attribute: &DidDocAttribute, +) -> VdrResult { + debug!( + "EthereumExtDidRegistry::build_did_revoke_attribute_endorsing_data >>> did: {:?}, attribute: {:?}", + did, attribute + ); + + let identity = Address::try_from(did)?; + let bytes = TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param((&identity).try_into()?) + .add_param(MethodParam::from(METHOD_REVOKE_ATTRIBUTE).into()) + .add_param((&attribute.name()?).try_into()?) + .add_param((&attribute.value()?).into()) + .build(client) + .await?; + + info!( + "EthereumExtDidRegistry::build_did_revoke_attribute_endorsing_data <<< bytes: {:?}", + bytes + ); + + Ok(bytes) } /// Build transaction to execute EthereumExtDidRegistry.revokeAttributeSigned contract method to revoke @@ -389,13 +691,38 @@ pub async fn build_did_revoke_attribute_transaction( /// #Returns /// transaction: Transaction - prepared write transaction object to sign and submit pub async fn build_did_revoke_attribute_signed_transaction( - _client: &LedgerClient, - _sender: &Address, - _did: &DID, - _attribute: &DidDocAttribute, - _signature: &SignatureData, + client: &LedgerClient, + sender: &Address, + did: &DID, + attribute: &DidDocAttribute, + signature: &SignatureData, ) -> VdrResult { - unimplemented!() + debug!( + "EthereumExtDidRegistry::build_did_revoke_attribute_signed_transaction >>> did: {:?}, attribute: {:?}", + did, attribute + ); + + let identity = Address::try_from(did)?; + let transaction = TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_REVOKE_ATTRIBUTE_SIGNED) + .add_param((&identity).try_into()?) + .add_param(signature.v().into()) + .add_param(signature.r().into()) + .add_param(signature.s().into()) + .add_param((&attribute.name()?).try_into()?) + .add_param((&attribute.value()?).into()) + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await?; + + info!( + "EthereumExtDidRegistry::build_did_revoke_attribute_signed_transaction <<< transaction: {:?}", + transaction + ); + + Ok(transaction) } /// Build transaction to execute EthereumExtDidRegistry.owners contract method to get @@ -411,7 +738,10 @@ pub async fn build_get_did_owner_transaction( client: &LedgerClient, did: &DID, ) -> VdrResult { - debug!("{} txn build has started. Did: {:?}", METHOD_DID_OWNER, did); + debug!( + "EthereumExtDidRegistry::build_get_did_owner_transaction >>> did: {:?}", + did + ); let identity = Address::try_from(did)?; let transaction = TransactionBuilder::new() @@ -420,14 +750,14 @@ pub async fn build_get_did_owner_transaction( .add_param((&identity).try_into()?) .set_type(TransactionType::Read) .build(client) - .await; + .await?; info!( - "{} txn build has finished. Result: {:?}", - METHOD_DID_OWNER, transaction + "EthereumExtDidRegistry::build_get_did_owner_transaction <<< transaction: {:?}", + did ); - transaction + Ok(transaction) } /// Build transaction to execute EthereumExtDidRegistry.changed contract method to get @@ -444,8 +774,8 @@ pub async fn build_get_did_changed_transaction( did: &DID, ) -> VdrResult { debug!( - "{} txn build has started. Did: {:?}", - METHOD_DID_CHANGED, did + "EthereumExtDidRegistry::build_get_did_changed_transaction >>> did: {:?}", + did ); let identity = Address::try_from(did)?; @@ -455,14 +785,14 @@ pub async fn build_get_did_changed_transaction( .add_param((&identity).try_into()?) .set_type(TransactionType::Read) .build(client) - .await; + .await?; info!( - "{} txn build has finished. Result: {:?}", - METHOD_DID_CHANGED, transaction + "EthereumExtDidRegistry::build_get_did_changed_transaction <<< transaction: {:?}", + transaction ); - transaction + Ok(transaction) } /// Build transaction to execute EthereumExtDidRegistry.nonce contract method to get signing @@ -474,27 +804,29 @@ pub async fn build_get_did_changed_transaction( /// /// #Returns /// transaction: Transaction - prepared read transaction object to submit -pub async fn build_get_did_nonce_transaction( +pub async fn build_get_identity_nonce_transaction( client: &LedgerClient, - did: &DID, + identity: &Address, ) -> VdrResult { - debug!("{} txn build has started. Did: {:?}", METHOD_DID_NONCE, did); + debug!( + "EthereumExtDidRegistry::build_get_did_nonce_transaction >>> identity: {:?}", + identity + ); - let identity = Address::try_from(did)?; let transaction = TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_DID_NONCE) - .add_param((&identity).try_into()?) + .add_param(identity.try_into()?) .set_type(TransactionType::Read) .build(client) - .await; + .await?; info!( - "{} txn build has finished. Result: {:?}", - METHOD_DID_NONCE, transaction + "EthereumExtDidRegistry::build_get_did_nonce_transaction <<< transaction: {:?}", + identity ); - transaction + Ok(transaction) } /// Build event query to obtain log DID associated events from the ledger @@ -513,7 +845,10 @@ pub async fn build_get_did_events_query( from_block: Option<&Block>, to_block: Option<&Block>, ) -> VdrResult { - debug!("Get did change event txn build has started. Did: {:?}", did); + debug!( + "EthereumExtDidRegistry::build_get_did_events_query >>> did: {:?}, from_block: {:?}, to_block: {:?}", + did, from_block, to_block + ); let address = Address::try_from(did)?; let query = EventQueryBuilder::new() @@ -523,6 +858,11 @@ pub async fn build_get_did_events_query( .set_event_filer(address.to_filter()) .build(client)?; + info!( + "EthereumExtDidRegistry::build_get_did_events_query <<< query: {:?}", + query + ); + Ok(query) } @@ -537,21 +877,21 @@ pub async fn build_get_did_events_query( /// Block number pub fn parse_did_changed_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult { debug!( - "{} result parse has started. Bytes to parse: {:?}", - METHOD_DID_CHANGED, bytes + "EthereumExtDidRegistry::parse_did_changed_result >>> bytes: {:?}", + bytes ); let result = TransactionParser::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_DID_CHANGED) - .parse::(client, bytes); + .parse::(client, bytes)?; info!( - "{} result parse has finished. Result: {:?}", - METHOD_DID_CHANGED, result + "EthereumExtDidRegistry::parse_did_changed_result <<< result: {:?}", + result ); - result + Ok(result) } /// Parse the result of execution EthereumExtDidRegistry.owners contract method to receive @@ -565,21 +905,21 @@ pub fn parse_did_changed_result(client: &LedgerClient, bytes: &[u8]) -> VdrResul /// Owner account address pub fn parse_did_owner_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult
{ debug!( - "{} result parse has started. Bytes to parse: {:?}", - METHOD_DID_OWNER, bytes + "EthereumExtDidRegistry::parse_did_owner_result >>> bytes: {:?}", + bytes ); let result = TransactionParser::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_DID_OWNER) - .parse::
(client, bytes); + .parse::
(client, bytes)?; info!( - "{} result parse has finished. Result: {:?}", - METHOD_DID_OWNER, result + "EthereumExtDidRegistry::parse_did_owner_result <<< result: {:?}", + result ); - result + Ok(result) } /// Parse the result of execution EthereumExtDidRegistry.nonce contract method to receive @@ -593,8 +933,8 @@ pub fn parse_did_owner_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult< /// Nonce to use for endorsing pub fn parse_did_nonce_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult { debug!( - "{} result parse has started. Bytes to parse: {:?}", - METHOD_DID_NONCE, bytes + "EthereumExtDidRegistry::parse_did_nonce_result >>> bytes: {:?}", + bytes ); let result = TransactionParser::new() @@ -604,8 +944,8 @@ pub fn parse_did_nonce_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult< .value(); info!( - "{} result parse has finished. Result: {:?}", - METHOD_DID_NONCE, result + "EthereumExtDidRegistry::parse_did_nonce_result <<< result: {:?}", + result ); Ok(result) @@ -624,8 +964,8 @@ pub fn parse_did_attribute_changed_event_response( log: &EventLog, ) -> VdrResult { debug!( - "{} result parse has started. Log to parse: {:?}", - EVENT_DID_ATTRIBUTE_CHANGED, log + "EthereumExtDidRegistry::parse_did_attribute_changed_event_response >>> log: {:?}", + log ); let result = EventParser::new() @@ -634,8 +974,8 @@ pub fn parse_did_attribute_changed_event_response( .parse::(client, log)?; info!( - "{} result parse has finished. Result: {:?}", - EVENT_DID_ATTRIBUTE_CHANGED, result + "EthereumExtDidRegistry::parse_did_attribute_changed_event_response <<< result: {:?}", + result ); Ok(result) @@ -654,8 +994,8 @@ pub fn parse_did_delegate_changed_event_response( log: &EventLog, ) -> VdrResult { debug!( - "{} result parse has started. Log to parse: {:?}", - EVENT_DID_DELEGATE_CHANGED, log + "EthereumExtDidRegistry::parse_did_delegate_changed_event_response >>> log: {:?}", + log ); let result = EventParser::new() @@ -664,8 +1004,8 @@ pub fn parse_did_delegate_changed_event_response( .parse::(client, log)?; info!( - "{} result parse has finished. Result: {:?}", - EVENT_DID_DELEGATE_CHANGED, result + "EthereumExtDidRegistry::parse_did_delegate_changed_event_response <<< result: {:?}", + log ); Ok(result) @@ -684,8 +1024,8 @@ pub fn parse_did_owner_changed_event_response( log: &EventLog, ) -> VdrResult { debug!( - "{} result parse has started. Log to parse: {:?}", - EVENT_DID_OWNER_CHANGED, log + "EthereumExtDidRegistry::parse_did_owner_changed_event_response >>> log: {:?}", + log ); let result = EventParser::new() @@ -694,8 +1034,8 @@ pub fn parse_did_owner_changed_event_response( .parse::(client, log)?; info!( - "{} result parse has finished. Result: {:?}", - EVENT_DID_OWNER_CHANGED, result + "EthereumExtDidRegistry::parse_did_owner_changed_event_response <<< result: {:?}", + result ); Ok(result) @@ -710,7 +1050,10 @@ pub fn parse_did_owner_changed_event_response( /// # Returns /// Parsed DID event object pub fn parse_did_event_response(client: &LedgerClient, event: &EventLog) -> VdrResult { - debug!("Parse DID event has started. event: {:?}", event); + debug!( + "EthereumExtDidRegistry::parse_did_event_response >>> event: {:?}", + event + ); let contract = client.contract(CONTRACT_NAME)?; @@ -744,6 +1087,24 @@ pub fn parse_did_event_response(client: &LedgerClient, event: &EventLog) -> VdrR ))) } +pub async fn resolve_identity_nonce(client: &LedgerClient, identity: &Address) -> VdrResult { + debug!( + "EthereumExtDidRegistry::resolve_identity_nonce >>> identity: {:?}", + identity + ); + + let transaction = build_get_identity_nonce_transaction(client, identity).await?; + let response = client.submit_transaction(&transaction).await?; + let nonce = parse_did_nonce_result(client, &response)?; + + info!( + "EthereumExtDidRegistry::resolve_identity_nonce <<< nonce: {:?}", + nonce + ); + + Ok(nonce) +} + /// Single step function to resolve a DidDocument with metadata for teh given DID /// /// # Params @@ -759,7 +1120,7 @@ pub async fn resolve_did( options: Option<&DidResolutionOptions>, ) -> VdrResult { debug!( - "Resolve DID function has started. DID: {:?}, options: {:?}", + "EthereumExtDidRegistry::resolve_did >>> did: {:?}, options: {:?}", did, options ); @@ -799,7 +1160,10 @@ pub async fn resolve_did( did_document_metadata: DidMetadata::default(), did_resolution_metadata: DidResolutionMetadata::default(), }; - info!("Resolve DID with meta: {:?}", did_with_meta); + info!( + "EthereumExtDidRegistry::resolve_did <<< did_with_meta: {:?}", + did_with_meta + ); return Ok(did_with_meta); } @@ -882,8 +1246,11 @@ pub async fn resolve_did( }; } DidDocAttribute::Service(service) => { - did_doc_builder = - did_doc_builder.add_service(None, &service.type_, &service.service_endpoint); + did_doc_builder = did_doc_builder.add_service( + None, + &service.type_, + &service.service_endpoint, + ); } } } @@ -897,7 +1264,7 @@ pub async fn resolve_did( }; info!( - "Resolved DID Document with metadata. Result: {:?}", + "EthereumExtDidRegistry::resolve_did <<< did_with_meta: {:?}", did_with_meta ); diff --git a/indy-besu/vdr/src/contracts/did/types/did_doc_attribute.rs b/indy-besu/vdr/src/contracts/did/types/did_doc_attribute.rs index b9d480326..71e1c5271 100644 --- a/indy-besu/vdr/src/contracts/did/types/did_doc_attribute.rs +++ b/indy-besu/vdr/src/contracts/did/types/did_doc_attribute.rs @@ -1,7 +1,12 @@ -use crate::{contracts::{ - did::types::did_events::{DidAttributeChanged, DidEvents}, - ServiceEndpoint, -}, types::ContractParam, utils::format_bytes32_string, VdrError, VdrResult, VerificationKeyType}; +use crate::{ + contracts::{ + did::types::did_events::{DidAttributeChanged, DidEvents}, + ServiceEndpoint, + }, + types::ContractParam, + utils::format_bytes32_string, + VdrError, VdrResult, VerificationKeyType, +}; use base64::Engine; use ethabi::Uint; use serde_derive::{Deserialize, Serialize}; @@ -280,9 +285,9 @@ impl TryFrom<&DidAttributeChanged> for DidDocAttribute { let service_endpoint = if value.starts_with('{') { // if JSON serde_json::from_slice(&event.value) - .map_err(|err| VdrError::CommonInvalidData( - format!("Unable to convert DIDAttributeChangedEvent into service DidDocAttribute. Failed to parse value: {}", err) - ))? + .map_err(|err| VdrError::CommonInvalidData( + format!("Unable to convert DIDAttributeChangedEvent into service DidDocAttribute. Failed to parse value: {}", err) + ))? } else { ServiceEndpoint::String(value.to_string()) }; @@ -300,7 +305,7 @@ impl TryFrom<&DidAttributeChanged> for DidDocAttribute { } } -pub(crate) struct DidDocAttributeName(String); +pub(crate) struct DidDocAttributeName(pub(crate) String); impl TryFrom<&DidDocAttributeName> for ContractParam { type Error = VdrError; @@ -315,7 +320,7 @@ impl TryFrom<&DidDocAttributeName> for ContractParam { } } -pub(crate) struct DidDocAttributeValue(Vec); +pub(crate) struct DidDocAttributeValue(pub(crate) Vec); impl From<&DidDocAttributeValue> for ContractParam { fn from(value: &DidDocAttributeValue) -> Self { @@ -368,12 +373,18 @@ impl PublicKeyType { } } -impl Into for PublicKeyType { - fn into(self) -> VerificationKeyType { - match self { - PublicKeyType::EcdsaSecp256k1VerificationKey2020 => VerificationKeyType::EcdsaSecp256k1VerificationKey2020, - PublicKeyType::Ed25519VerificationKey2020 => VerificationKeyType::Ed25519VerificationKey2020, - PublicKeyType::X25519KeyAgreementKey2020 => VerificationKeyType::X25519KeyAgreementKey2020, +impl From for VerificationKeyType { + fn from(value: PublicKeyType) -> Self { + match value { + PublicKeyType::EcdsaSecp256k1VerificationKey2020 => { + VerificationKeyType::EcdsaSecp256k1VerificationKey2020 + } + PublicKeyType::Ed25519VerificationKey2020 => { + VerificationKeyType::Ed25519VerificationKey2020 + } + PublicKeyType::X25519KeyAgreementKey2020 => { + VerificationKeyType::X25519KeyAgreementKey2020 + } } } -} \ No newline at end of file +} diff --git a/indy-besu/vdr/src/contracts/did/types/did_doc_builder.rs b/indy-besu/vdr/src/contracts/did/types/did_doc_builder.rs index 2435fc8ef..9922865ae 100644 --- a/indy-besu/vdr/src/contracts/did/types/did_doc_builder.rs +++ b/indy-besu/vdr/src/contracts/did/types/did_doc_builder.rs @@ -207,10 +207,15 @@ impl DidDocumentBuilder { self.verification_method.len() } - pub fn add_service(mut self, id: Option<&str>, type_: &str, endpoint: &ServiceEndpoint) -> DidDocumentBuilder { - let id = id.map(String::from).unwrap_or_else(|| { - format!("#service-{}", self.service.len() + 1) - }); + pub fn add_service( + mut self, + id: Option<&str>, + type_: &str, + endpoint: &ServiceEndpoint, + ) -> DidDocumentBuilder { + let id = id + .map(String::from) + .unwrap_or_else(|| format!("#service-{}", self.service.len() + 1)); let service = Service { id, type_: type_.to_string(), diff --git a/indy-besu/vdr/src/test.rs b/indy-besu/vdr/src/test.rs index 058da0a58..ef8b2a85e 100644 --- a/indy-besu/vdr/src/test.rs +++ b/indy-besu/vdr/src/test.rs @@ -77,8 +77,8 @@ mod did { did::{ did_ethr_registry, types::did_doc_attribute::{ - DidDocAttribute, PublicKeyAttribute, PublicKeyPurpose, ServiceAttribute, - Validity, + DidDocAttribute, PublicKeyAttribute, PublicKeyPurpose, PublicKeyType, + ServiceAttribute, Validity, }, }, ServiceEndpoint, @@ -86,7 +86,6 @@ mod did { did_indy_registry, DID, }; use serde_json::json; - use crate::contracts::did::types::did_doc_attribute::PublicKeyType; pub(crate) async fn build_and_submit_create_did_doc_transaction( client: &LedgerClient, @@ -142,7 +141,7 @@ mod did { type_: "HubService".to_string(), service_endpoint: ServiceEndpoint::String("https://hubs.uport.me".to_string()), }), - Some(Validity(10000)), + &Validity(10000), ) .await .unwrap(); @@ -180,7 +179,56 @@ mod did { public_key_base58: Some("FbQWLPRhTH95MCkQUeFYdiSoQt8zMwetqfWoxqPgaq7x".to_string()), public_key_pem: None, }), - Some(Validity(10000)), + &Validity(10000), + ) + .await + .unwrap(); + let receipt = sign_and_submit_transaction(&client, transaction, &signer).await; + println!("Receipt: {}", receipt); + + let did_doc = did_ethr_registry::resolve_did(&client, &did, None) + .await + .unwrap(); + println!("did_doc {}", json!(did_doc).to_string()); + + Ok(()) + } + + #[async_std::test] + async fn demo_endorse_did_ethr_transaction_test() -> VdrResult<()> { + let mut signer = basic_signer(); + let client = client(); + + let (identity, _) = signer.create_key(None)?; + + // write + let did = DID::from(format!("did:ethr:{}", identity.to_string()).as_str()); + let service = DidDocAttribute::Service(ServiceAttribute { + type_: "HubService".to_string(), + service_endpoint: ServiceEndpoint::String("https://hubs.uport.me".to_string()), + }); + let validity = Validity(10000); + + let transaction_endorsing_data = did_ethr_registry::build_did_set_attribute_endorsing_data( + &client, &did, &service, &validity, + ) + .await + .unwrap(); + + let signature = signer + .sign( + &transaction_endorsing_data.get_signing_bytes()?, + &identity.to_string(), + ) + .unwrap(); + + let transaction = did_ethr_registry::build_did_set_attribute_signed_transaction( + &client, + &TRUSTEE_ACC, + &did, + &service, + &validity, + &signature, ) .await .unwrap(); diff --git a/indy-besu/vdr/src/types/address.rs b/indy-besu/vdr/src/types/address.rs index 40a97fa8c..d40f409eb 100644 --- a/indy-besu/vdr/src/types/address.rs +++ b/indy-besu/vdr/src/types/address.rs @@ -80,7 +80,7 @@ impl TryFrom for Address { value ); - let acc_address = Address(value.get_string(0)?); + let acc_address = value.get_address(0)?; trace!( "Address convert from ContractOutput: {:?} has finished. Result: {:?}", @@ -91,6 +91,7 @@ impl TryFrom for Address { Ok(acc_address) } } + impl TryFrom<&DID> for Address { type Error = VdrError; diff --git a/indy-besu/vdr/src/types/contract.rs b/indy-besu/vdr/src/types/contract.rs index b83c399e1..713fb9c11 100644 --- a/indy-besu/vdr/src/types/contract.rs +++ b/indy-besu/vdr/src/types/contract.rs @@ -3,6 +3,7 @@ use crate::{ Address, }; +use crate::utils::format_bytes32; use ethabi::{Log, Token}; use log::{trace, warn}; use serde::{Deserialize, Serialize}; @@ -160,6 +161,15 @@ impl ContractOutput { .as_u64()) } + pub fn get_bytes(&self, index: usize) -> VdrResult> { + self.0 + .get(index) + .ok_or_else(|| VdrError::ContractInvalidResponseData("Missing uint value".to_string()))? + .clone() + .into_fixed_bytes() + .ok_or_else(|| VdrError::ContractInvalidResponseData("Missing uint value".to_string())) + } + pub fn get_u128(&self, index: usize) -> VdrResult { Ok(self .0 @@ -322,3 +332,35 @@ impl From for ContractEvent { ContractEvent(value) } } + +pub struct UintBytesParam(u64); + +impl From for UintBytesParam { + fn from(value: u64) -> Self { + UintBytesParam(value) + } +} + +impl TryFrom for ContractParam { + type Error = VdrError; + + fn try_from(value: UintBytesParam) -> Result { + Ok(ContractParam::FixedBytes( + format_bytes32(value.0.to_be_bytes().as_slice())?.to_vec(), + )) + } +} + +pub struct MethodParam(&'static str); + +impl From<&'static str> for MethodParam { + fn from(value: &'static str) -> Self { + MethodParam(value) + } +} + +impl From for ContractParam { + fn from(value: MethodParam) -> Self { + ContractParam::String(value.0.to_string()) + } +} diff --git a/indy-besu/vdr/src/types/event_query.rs b/indy-besu/vdr/src/types/event_query.rs index 2465fa1aa..9160d79e1 100644 --- a/indy-besu/vdr/src/types/event_query.rs +++ b/indy-besu/vdr/src/types/event_query.rs @@ -1,8 +1,8 @@ use crate::{ - types::{ContractEvent, ContractOutput, ContractParam}, + types::{transaction::Block, ContractEvent}, Address, LedgerClient, VdrError, VdrResult, }; -use ethabi::{Hash, RawLog, Uint}; +use ethabi::{Hash, RawLog}; use log::{trace, warn}; use serde_derive::{Deserialize, Serialize}; @@ -18,39 +18,6 @@ pub struct EventQuery { pub event_filter: Option, } -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] -pub struct Block(u64); - -impl Block { - pub fn value(&self) -> u64 { - self.0 - } - - pub fn is_none(&self) -> bool { - self.0 == 0 - } -} - -impl From for Block { - fn from(value: u64) -> Self { - Block(value) - } -} - -impl TryFrom for Block { - type Error = VdrError; - - fn try_from(value: ContractOutput) -> Result { - Ok(Block::from(value.get_u64(0)?)) - } -} - -impl From<&Block> for ContractParam { - fn from(value: &Block) -> Self { - ContractParam::Uint(Uint::from(value.0)) - } -} - #[derive(Clone, Debug, Default, PartialEq)] pub struct EventQueryBuilder { contract: String, diff --git a/indy-besu/vdr/src/types/mod.rs b/indy-besu/vdr/src/types/mod.rs index bed627929..0e86c9471 100644 --- a/indy-besu/vdr/src/types/mod.rs +++ b/indy-besu/vdr/src/types/mod.rs @@ -1,14 +1,22 @@ mod address; mod contract; mod event_query; +mod signature; mod status; mod transaction; pub use address::Address; pub use contract::{ContractConfig, ContractSpec}; -pub(crate) use contract::{ContractEvent, ContractOutput, ContractParam}; -pub use event_query::{Block, EventLog, EventQuery}; +pub(crate) use contract::{ + ContractEvent, ContractOutput, ContractParam, MethodParam, UintBytesParam, +}; +pub use event_query::{EventLog, EventQuery}; pub(crate) use event_query::{EventParser, EventQueryBuilder}; +pub use signature::{SignatureData, SignatureR, SignatureS, SignatureV}; pub use status::{PingStatus, Status}; -pub use transaction::{SignatureData, Transaction, TransactionSignature, TransactionType}; -pub(crate) use transaction::{TransactionBuilder, TransactionParser}; +pub use transaction::{ + Block, Transaction, TransactionEndorsingData, TransactionSignature, TransactionType, +}; +pub(crate) use transaction::{ + TransactionBuilder, TransactionEndorsingDataBuilder, TransactionParser, +}; diff --git a/indy-besu/vdr/src/types/signature.rs b/indy-besu/vdr/src/types/signature.rs new file mode 100644 index 000000000..5a5d5694c --- /dev/null +++ b/indy-besu/vdr/src/types/signature.rs @@ -0,0 +1,51 @@ +use crate::types::ContractParam; +use serde_derive::{Deserialize, Serialize}; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct SignatureData { + /// recovery ID using for public key recovery + pub recovery_id: u64, + /// ECDSA signature + pub signature: Vec, +} + +impl SignatureData { + pub fn v(&self) -> SignatureV { + SignatureV(self.recovery_id) + } + + pub fn r(&self) -> SignatureR { + SignatureR(self.signature[..32].to_vec()) + } + + pub fn s(&self) -> SignatureS { + SignatureS(self.signature[32..].to_vec()) + } +} + +#[derive(Debug)] +pub struct SignatureV(pub u64); + +impl From for ContractParam { + fn from(value: SignatureV) -> Self { + ContractParam::Uint((value.0 + 27).into()) + } +} + +#[derive(Debug)] +pub struct SignatureR(pub Vec); + +impl From for ContractParam { + fn from(value: SignatureR) -> Self { + ContractParam::FixedBytes(value.0) + } +} + +#[derive(Debug)] +pub struct SignatureS(pub Vec); + +impl From for ContractParam { + fn from(value: SignatureS) -> Self { + ContractParam::FixedBytes(value.0) + } +} diff --git a/indy-besu/vdr/src/types/transaction.rs b/indy-besu/vdr/src/types/transaction.rs index a50f8a746..93ca746fd 100644 --- a/indy-besu/vdr/src/types/transaction.rs +++ b/indy-besu/vdr/src/types/transaction.rs @@ -1,3 +1,4 @@ +use ethabi::Uint; use ethereum::{ EnvelopedEncodable, LegacyTransaction, LegacyTransactionMessage, TransactionAction, TransactionSignature as EthTransactionSignature, @@ -5,12 +6,16 @@ use ethereum::{ use ethereum_types::{H160, H256, U256}; use log::{trace, warn}; use serde_derive::{Deserialize, Serialize}; +use sha3::Digest; use std::{str::FromStr, sync::RwLock}; use crate::{ client::{GAS_LIMIT, GAS_PRICE}, + did_ethr_registry::resolve_identity_nonce, error::{VdrError, VdrResult}, - types::{Address, ContractOutput, ContractParam}, + types::{ + contract::UintBytesParam, signature::SignatureData, Address, ContractOutput, ContractParam, + }, LedgerClient, }; @@ -37,7 +42,7 @@ pub struct Transaction { pub to: Address, /// nonce - count of transaction sent by account #[serde(skip_serializing_if = "Option::is_none")] - pub nonce: Option>, + pub nonce: Option, /// chain id of the ledger pub chain_id: u64, /// transaction payload @@ -48,14 +53,6 @@ pub struct Transaction { pub hash: Option>, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct SignatureData { - /// recovery ID using for public key recovery - pub recovery_id: u64, - /// ECDSA signature - pub signature: Vec, -} - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct TransactionSignature { pub v: u64, @@ -70,7 +67,7 @@ impl Transaction { to: Address, chain_id: u64, data: Vec, - nonce: Option>, + nonce: Option, signature: Option, ) -> Transaction { Transaction { @@ -100,14 +97,12 @@ impl Transaction { } pub fn set_signature(&self, signature_data: SignatureData) { - let v = signature_data.recovery_id + 35 + self.chain_id * 2; - let transaction_signature = TransactionSignature { - v, - r: signature_data.signature[..32].to_vec(), - s: signature_data.signature[32..].to_vec(), - }; let mut signature = self.signature.write().unwrap(); - *signature = Some(transaction_signature) + *signature = Some(TransactionSignature { + v: signature_data.v().0 + 35 + self.chain_id * 2, + r: signature_data.r().0, + s: signature_data.s().0, + }) } pub fn encode(&self) -> VdrResult> { @@ -133,16 +128,10 @@ impl Transaction { } fn get_nonce(&self) -> VdrResult { - let nonce: [u64; 4] = self - .nonce - .as_ref() - .ok_or_else(|| { - VdrError::ClientInvalidTransaction("Transaction `nonce` is not set".to_string()) - })? - .clone() - .try_into() - .map_err(|_| VdrError::CommonInvalidData("Invalid nonce provided".to_string()))?; - Ok(U256(nonce)) + let nonce = self.nonce.ok_or_else(|| { + VdrError::ClientInvalidTransaction("Transaction `nonce` is not set".to_string()) + })?; + Ok(U256::from(nonce)) } fn get_transaction_signature(&self) -> VdrResult { @@ -178,6 +167,22 @@ impl PartialEq for Transaction { } } +#[cfg(test)] +impl Clone for Transaction { + fn clone(&self) -> Self { + Transaction { + type_: self.type_.clone(), + from: self.from.clone(), + to: self.to.clone(), + nonce: self.nonce.clone(), + chain_id: self.chain_id.clone(), + data: self.data.clone(), + signature: RwLock::new(self.signature.read().unwrap().clone()), + hash: self.hash.clone(), + } + } +} + #[derive(Clone, Debug, Default, PartialEq)] pub struct TransactionBuilder { contract: String, @@ -346,18 +351,107 @@ impl TransactionParser { } } -#[cfg(test)] -impl std::clone::Clone for Transaction { - fn clone(&self) -> Self { - Transaction { - type_: self.type_.clone(), - from: self.from.clone(), - to: self.to.clone(), - nonce: self.nonce.clone(), - chain_id: self.chain_id.clone(), - data: self.data.clone(), - signature: RwLock::new(self.signature.read().unwrap().clone()), - hash: self.hash.clone(), - } +/// Transaction Endorsing object +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct TransactionEndorsingData { + pub to: Address, + pub from: Address, + #[serde(skip_serializing_if = "Option::is_none")] + pub nonce: Option, + pub params: Vec, +} + +impl TransactionEndorsingData { + pub fn get_signing_bytes(&self) -> VdrResult> { + let prefix = 0x19_u8; + let version = vec![0]; + + let nonce: u64 = self + .nonce + .ok_or_else(|| VdrError::ClientInvalidState("Unable to get nonce".to_string()))?; + + let mut tokens = vec![ + ContractParam::Uint(Uint::from(prefix)), + ContractParam::FixedBytes(version), + (&self.to).try_into()?, + UintBytesParam::from(nonce).try_into()?, + ]; + tokens.extend_from_slice(self.params.as_slice()); + + let encoded = ethers_core::abi::encode_packed(&tokens).unwrap(); + let hash = sha3::Keccak256::digest(encoded).to_vec(); + Ok(hash) + } +} + +#[derive(Default)] +pub struct TransactionEndorsingDataBuilder { + contract: String, + identity: Address, + params: Vec, +} + +impl TransactionEndorsingDataBuilder { + pub fn new() -> TransactionEndorsingDataBuilder { + TransactionEndorsingDataBuilder::default() + } + + pub fn set_contract(mut self, contract: &str) -> TransactionEndorsingDataBuilder { + self.contract = contract.to_string(); + self + } + + pub fn set_identity(mut self, identity: &Address) -> TransactionEndorsingDataBuilder { + self.identity = identity.to_owned(); + self + } + + pub fn add_param(mut self, param: ContractParam) -> TransactionEndorsingDataBuilder { + self.params.push(param); + self + } + + pub async fn build(self, client: &LedgerClient) -> VdrResult { + let contract = client.contract(&self.contract)?; + let nonce: u64 = resolve_identity_nonce(client, &self.identity).await?; + Ok(TransactionEndorsingData { + to: contract.address().to_owned(), + from: self.identity.to_owned(), + nonce: Some(nonce), + params: self.params, + }) + } +} + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +pub struct Block(u64); + +impl Block { + pub fn value(&self) -> u64 { + self.0 + } + + pub fn is_none(&self) -> bool { + self.0 == 0 + } +} + +impl From for Block { + fn from(value: u64) -> Self { + Block(value) + } +} + +impl TryFrom for Block { + type Error = VdrError; + + fn try_from(value: ContractOutput) -> Result { + Ok(Block::from(value.get_u64(0)?)) + } +} + +impl From<&Block> for ContractParam { + fn from(value: &Block) -> Self { + ContractParam::Uint(Uint::from(value.0)) } } diff --git a/indy-besu/vdr/src/utils/mod.rs b/indy-besu/vdr/src/utils/mod.rs index 76435ad7a..09478af8d 100644 --- a/indy-besu/vdr/src/utils/mod.rs +++ b/indy-besu/vdr/src/utils/mod.rs @@ -18,6 +18,19 @@ pub fn format_bytes32_string(string: &str) -> VdrResult<[u8; 32]> { Ok(bytes32) } +pub fn format_bytes32(bytes: &[u8]) -> VdrResult<[u8; 32]> { + if bytes.len() > 32 { + return Err(VdrError::CommonInvalidData( + "Unable to represent string as bytes32".to_string(), + )); + } + + let mut bytes32: [u8; 32] = [0u8; 32]; + bytes32[32 - bytes.len()..32].copy_from_slice(bytes); + + Ok(bytes32) +} + pub fn parse_bytes32_string(bytes: &[u8]) -> VdrResult<&str> { let mut length = 0; while length < 32 && bytes[length] != 0 { diff --git a/indy-besu/vdr/uniffi/src/ffi/client.rs b/indy-besu/vdr/uniffi/src/ffi/client.rs index 4ec5ab2af..cbc3207c5 100644 --- a/indy-besu/vdr/uniffi/src/ffi/client.rs +++ b/indy-besu/vdr/uniffi/src/ffi/client.rs @@ -1,8 +1,8 @@ use crate::{ ffi::{ error::VdrResult, + event_query::{EventLog, EventQuery}, transaction::Transaction, - event_query::{EventQuery, EventLog}, types::{ContractConfig, PingStatus, QuorumConfig}, }, VdrError, @@ -50,15 +50,13 @@ impl LedgerClient { } pub async fn query_events(&self, query: &EventQuery) -> VdrResult> { - Ok( - self.client - .query_events(&query.query) - .await? - .into_iter() - .map(EventLog::from) - .collect() - ) - + Ok(self + .client + .query_events(&query.query) + .await? + .into_iter() + .map(EventLog::from) + .collect()) } pub async fn get_receipt(&self, hash: Vec) -> VdrResult { diff --git a/indy-besu/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs b/indy-besu/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs index 90e62ec75..07a067692 100644 --- a/indy-besu/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs +++ b/indy-besu/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs @@ -1,24 +1,19 @@ -use crate::ffi::{ - client::LedgerClient, - error::{VdrError, VdrResult}, - transaction::Transaction, +use crate::{ + ffi::{ + client::LedgerClient, + error::{VdrError, VdrResult}, + transaction::{Transaction, TransactionEndorsingData}, + types::SignatureData, + }, + EventLog, EventQuery, }; use indy2_vdr::{ - did_ethr_registry, - Address, + did_ethr_registry, Address, Block, DelegateType, DidAttributeChanged as DidAttributeChanged_, + DidDelegateChanged as DidDelegateChanged_, DidDocAttribute, DidEvents as DidEvents_, + DidOwnerChanged as DidOwnerChanged_, DidResolutionOptions as DidResolutionOptions_, Validity, DID, - DelegateType, - Validity, - DidDocAttribute, - Block, - DidAttributeChanged as DidAttributeChanged_, - DidDelegateChanged as DidDelegateChanged_, - DidOwnerChanged as DidOwnerChanged_, - DidEvents as DidEvents_, - DidResolutionOptions as DidResolutionOptions_, }; use serde_json::json; -use crate::{EventLog, EventQuery}; #[uniffi::export(async_runtime = "tokio")] pub async fn build_did_change_owner_transaction( @@ -33,9 +28,45 @@ pub async fn build_did_change_owner_transaction( &DID::from(did), &Address::from(new_owner), ) - .await - .map(Transaction::from) - .map_err(VdrError::from) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_change_owner_endorsing_data( + client: &LedgerClient, + did: &str, + new_owner: &str, +) -> VdrResult { + did_ethr_registry::build_did_change_owner_endorsing_data( + &client.client, + &DID::from(did), + &Address::from(new_owner), + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_change_owner_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + new_owner: &str, + signature: SignatureData, +) -> VdrResult { + did_ethr_registry::build_did_change_owner_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &Address::from(new_owner), + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) } #[uniffi::export(async_runtime = "tokio")] @@ -45,7 +76,7 @@ pub async fn build_did_add_delegate_transaction( did: &str, delegate_type: &str, delegate: &str, - validity: Option, + validity: u64, ) -> VdrResult { did_ethr_registry::build_did_add_delegate_transaction( &client.client, @@ -53,11 +84,55 @@ pub async fn build_did_add_delegate_transaction( &DID::from(did), &DelegateType::try_from(delegate_type)?, &Address::from(delegate), - validity.map(Validity::from), + &Validity::from(validity), ) - .await - .map(Transaction::from) - .map_err(VdrError::from) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_add_delegate_endorsing_data( + client: &LedgerClient, + did: &str, + delegate_type: &str, + delegate: &str, + validity: u64, +) -> VdrResult { + did_ethr_registry::build_did_add_delegate_endorsing_data( + &client.client, + &DID::from(did), + &DelegateType::try_from(delegate_type)?, + &Address::from(delegate), + &Validity::from(validity), + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_add_delegate_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + delegate_type: &str, + delegate: &str, + validity: u64, + signature: SignatureData, +) -> VdrResult { + did_ethr_registry::build_did_add_delegate_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &DelegateType::try_from(delegate_type)?, + &Address::from(delegate), + &Validity::from(validity), + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) } #[uniffi::export(async_runtime = "tokio")] @@ -75,9 +150,49 @@ pub async fn build_did_revoke_delegate_transaction( &DelegateType::try_from(delegate_type)?, &Address::from(delegate), ) - .await - .map(Transaction::from) - .map_err(VdrError::from) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_revoke_delegate_endorsing_data( + client: &LedgerClient, + did: &str, + delegate_type: &str, + delegate: &str, +) -> VdrResult { + did_ethr_registry::build_did_revoke_delegate_endorsing_data( + &client.client, + &DID::from(did), + &DelegateType::try_from(delegate_type)?, + &Address::from(delegate), + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_revoke_delegate_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + delegate_type: &str, + delegate: &str, + signature: SignatureData, +) -> VdrResult { + did_ethr_registry::build_did_revoke_delegate_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &DelegateType::try_from(delegate_type)?, + &Address::from(delegate), + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) } #[uniffi::export(async_runtime = "tokio")] @@ -86,22 +201,73 @@ pub async fn build_did_set_attribute_transaction( from: &str, did: &str, attribute: &str, - validity: Option, + validity: u64, ) -> VdrResult { - let attribute: DidDocAttribute = serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { - msg: format!("Unable to parse DID Attribute. Err: {:?}", err), - })?; + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; did_ethr_registry::build_did_set_attribute_transaction( &client.client, &Address::from(from), &DID::from(did), &attribute, - validity.map(Validity::from), + &Validity::from(validity), ) - .await - .map(Transaction::from) - .map_err(VdrError::from) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_set_attribute_endorsing_data( + client: &LedgerClient, + did: &str, + attribute: &str, + validity: u64, +) -> VdrResult { + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; + + did_ethr_registry::build_did_set_attribute_endorsing_data( + &client.client, + &DID::from(did), + &attribute, + &Validity::from(validity), + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_set_attribute_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + attribute: &str, + validity: u64, + signature: SignatureData, +) -> VdrResult { + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; + + did_ethr_registry::build_did_set_attribute_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &attribute, + &Validity::from(validity), + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) } #[uniffi::export(async_runtime = "tokio")] @@ -111,9 +277,10 @@ pub async fn build_did_revoke_attribute_transaction( did: &str, attribute: &str, ) -> VdrResult { - let attribute: DidDocAttribute = serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { - msg: format!("Unable to parse DID Attribute. Err: {:?}", err), - })?; + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; did_ethr_registry::build_did_revoke_attribute_transaction( &client.client, @@ -121,53 +288,93 @@ pub async fn build_did_revoke_attribute_transaction( &DID::from(did), &attribute, ) - .await - .map(Transaction::from) - .map_err(VdrError::from) + .await + .map(Transaction::from) + .map_err(VdrError::from) } #[uniffi::export(async_runtime = "tokio")] -pub async fn build_get_did_owner_transaction( +pub async fn build_did_revoke_attribute_endorsing_data( client: &LedgerClient, did: &str, -) -> VdrResult { - did_ethr_registry::build_get_did_owner_transaction( + attribute: &str, +) -> VdrResult { + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; + + did_ethr_registry::build_did_revoke_attribute_endorsing_data( &client.client, &DID::from(did), + &attribute, ) - .await - .map(Transaction::from) - .map_err(VdrError::from) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) } #[uniffi::export(async_runtime = "tokio")] -pub async fn build_get_did_changed_transaction( +pub async fn build_did_revoke_attribute_signed_transaction( client: &LedgerClient, + from: &str, did: &str, + attribute: &str, + signature: SignatureData, ) -> VdrResult { - did_ethr_registry::build_get_did_changed_transaction( + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; + + did_ethr_registry::build_did_revoke_attribute_signed_transaction( &client.client, + &Address::from(from), &DID::from(did), + &attribute, + &signature.into(), ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_did_owner_transaction( + client: &LedgerClient, + did: &str, +) -> VdrResult { + did_ethr_registry::build_get_did_owner_transaction(&client.client, &DID::from(did)) .await .map(Transaction::from) .map_err(VdrError::from) } #[uniffi::export(async_runtime = "tokio")] -pub async fn build_get_did_nonce_transaction( +pub async fn build_get_did_changed_transaction( client: &LedgerClient, did: &str, ) -> VdrResult { - did_ethr_registry::build_get_did_nonce_transaction( - &client.client, - &DID::from(did), - ) + did_ethr_registry::build_get_did_changed_transaction(&client.client, &DID::from(did)) .await .map(Transaction::from) .map_err(VdrError::from) } +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_identity_nonce_transaction( + client: &LedgerClient, + identity: &str, +) -> VdrResult { + did_ethr_registry::build_get_identity_nonce_transaction( + &client.client, + &Address::from(identity), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + #[uniffi::export(async_runtime = "tokio")] pub async fn build_get_did_events_query( client: &LedgerClient, @@ -181,9 +388,9 @@ pub async fn build_get_did_events_query( from_block.map(Block::from).as_ref(), to_block.map(Block::from).as_ref(), ) - .await - .map(EventQuery::from) - .map_err(VdrError::from) + .await + .map(EventQuery::from) + .map_err(VdrError::from) } #[uniffi::export] @@ -199,52 +406,54 @@ pub fn parse_did_owner_result(client: &LedgerClient, bytes: Vec) -> VdrResul } #[uniffi::export] -pub fn parse_did_attribute_changed_event_response(client: &LedgerClient, log: EventLog) -> VdrResult { - did_ethr_registry::parse_did_attribute_changed_event_response( - &client.client, - &log.into(), - ) +pub fn parse_did_attribute_changed_event_response( + client: &LedgerClient, + log: EventLog, +) -> VdrResult { + did_ethr_registry::parse_did_attribute_changed_event_response(&client.client, &log.into()) .map(DidAttributeChanged::from) .map_err(VdrError::from) } #[uniffi::export] -pub fn parse_did_delegate_changed_event_response(client: &LedgerClient, log: EventLog) -> VdrResult { - did_ethr_registry::parse_did_delegate_changed_event_response( - &client.client, - &log.into(), - ) +pub fn parse_did_delegate_changed_event_response( + client: &LedgerClient, + log: EventLog, +) -> VdrResult { + did_ethr_registry::parse_did_delegate_changed_event_response(&client.client, &log.into()) .map(DidDelegateChanged::from) .map_err(VdrError::from) } #[uniffi::export] -pub fn parse_did_owner_changed_event_response(client: &LedgerClient, log: EventLog) -> VdrResult { - did_ethr_registry::parse_did_owner_changed_event_response( - &client.client, - &log.into(), - ) +pub fn parse_did_owner_changed_event_response( + client: &LedgerClient, + log: EventLog, +) -> VdrResult { + did_ethr_registry::parse_did_owner_changed_event_response(&client.client, &log.into()) .map(DidOwnerChanged::from) .map_err(VdrError::from) } #[uniffi::export] pub fn parse_did_event_response(client: &LedgerClient, log: EventLog) -> VdrResult { - did_ethr_registry::parse_did_event_response( - &client.client, - &log.into(), - ) + did_ethr_registry::parse_did_event_response(&client.client, &log.into()) .map(DidEvents::from) .map_err(VdrError::from) } #[uniffi::export] -pub async fn resolve_did(client: &LedgerClient, did: &str, options: Option) -> VdrResult { +pub async fn resolve_did( + client: &LedgerClient, + did: &str, + options: Option, +) -> VdrResult { let did_with_meta = did_ethr_registry::resolve_did( &client.client, &DID::from(did), options.map(DidResolutionOptions_::from).as_ref(), - ).await?; + ) + .await?; Ok(json!(did_with_meta).to_string()) } @@ -309,23 +518,23 @@ impl From for DidOwnerChanged { #[derive(uniffi::Enum)] pub enum DidEvents { - AttributeChangedEvent { - event: DidAttributeChanged - }, - DelegateChanged { - event: DidDelegateChanged - }, - OwnerChanged { - event: DidOwnerChanged - }, + AttributeChangedEvent { event: DidAttributeChanged }, + DelegateChanged { event: DidDelegateChanged }, + OwnerChanged { event: DidOwnerChanged }, } impl From for DidEvents { fn from(event: DidEvents_) -> Self { match event { - DidEvents_::AttributeChangedEvent(event) => DidEvents::AttributeChangedEvent { event: event.into() }, - DidEvents_::DelegateChanged(event) => DidEvents::DelegateChanged { event: event.into() }, - DidEvents_::OwnerChanged(event) => DidEvents::OwnerChanged { event: event.into() }, + DidEvents_::AttributeChangedEvent(event) => DidEvents::AttributeChangedEvent { + event: event.into(), + }, + DidEvents_::DelegateChanged(event) => DidEvents::DelegateChanged { + event: event.into(), + }, + DidEvents_::OwnerChanged(event) => DidEvents::OwnerChanged { + event: event.into(), + }, } } } @@ -341,4 +550,4 @@ impl From for DidResolutionOptions_ { accept: options.accept, } } -} \ No newline at end of file +} diff --git a/indy-besu/vdr/uniffi/src/ffi/contracts/did_indy_registry.rs b/indy-besu/vdr/uniffi/src/ffi/contracts/did_indy_registry.rs index f41dd2b22..b24390f4e 100644 --- a/indy-besu/vdr/uniffi/src/ffi/contracts/did_indy_registry.rs +++ b/indy-besu/vdr/uniffi/src/ffi/contracts/did_indy_registry.rs @@ -17,15 +17,14 @@ pub async fn build_create_did_transaction( let did_doc = serde_json::from_str(did_doc).map_err(|err| VdrError::CommonInvalidData { msg: format!("Unable to parse DID DDocument. Err: {:?}", err), })?; - let transaction = - did_indy_registry::build_create_did_transaction( - &client.client, - &Address::from(from), - &Address::from(identity), - &DID::from(did), - &did_doc, - ) - .await?; + let transaction = did_indy_registry::build_create_did_transaction( + &client.client, + &Address::from(from), + &Address::from(identity), + &DID::from(did), + &did_doc, + ) + .await?; Ok(Transaction { transaction }) } @@ -39,14 +38,13 @@ pub async fn build_update_did_transaction( let did_doc = serde_json::from_str(did_doc).map_err(|err| VdrError::CommonInvalidData { msg: format!("Unable to parse DID DDocument. Err: {:?}", err), })?; - let transaction = - did_indy_registry::build_update_did_transaction( - &client.client, - &Address::from(from), - &DID::from(did), - &did_doc - ) - .await?; + let transaction = did_indy_registry::build_update_did_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &did_doc, + ) + .await?; Ok(Transaction { transaction }) } @@ -61,7 +59,7 @@ pub async fn build_deactivate_did_transaction( &Address::from(from), &DID::from(did), ) - .await?; + .await?; Ok(Transaction { transaction }) } diff --git a/indy-besu/vdr/uniffi/src/ffi/contracts/mod.rs b/indy-besu/vdr/uniffi/src/ffi/contracts/mod.rs index eacc75e3d..bb4ed2632 100644 --- a/indy-besu/vdr/uniffi/src/ffi/contracts/mod.rs +++ b/indy-besu/vdr/uniffi/src/ffi/contracts/mod.rs @@ -1,6 +1,6 @@ pub mod credential_definition_registry; -pub mod did_indy_registry; pub mod did_ethr_registry; +pub mod did_indy_registry; pub mod role_control; pub mod schema_registry; pub mod validator_control; diff --git a/indy-besu/vdr/uniffi/src/ffi/error.rs b/indy-besu/vdr/uniffi/src/ffi/error.rs index 3565d756d..bea3eb472 100644 --- a/indy-besu/vdr/uniffi/src/ffi/error.rs +++ b/indy-besu/vdr/uniffi/src/ffi/error.rs @@ -60,9 +60,7 @@ impl From for VdrError { fn from(error: VdrError_) -> Self { match error { VdrError_::ClientNodeUnreachable => VdrError::ClientNodeUnreachable, - VdrError_::ClientInvalidTransaction(msg) => { - VdrError::ClientInvalidTransaction { msg } - } + VdrError_::ClientInvalidTransaction(msg) => VdrError::ClientInvalidTransaction { msg }, VdrError_::ClientInvalidResponse(msg) => VdrError::ClientInvalidResponse { msg }, VdrError_::ClientTransactionReverted(msg) => { VdrError::ClientTransactionReverted { msg } diff --git a/indy-besu/vdr/uniffi/src/ffi/event_query.rs b/indy-besu/vdr/uniffi/src/ffi/event_query.rs index 1aeb2a8b2..68866eeeb 100644 --- a/indy-besu/vdr/uniffi/src/ffi/event_query.rs +++ b/indy-besu/vdr/uniffi/src/ffi/event_query.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{Address, Block, EventQuery as EventQuery_, EventLog as EventLog_}; +use indy2_vdr::{Address, Block, EventLog as EventLog_, EventQuery as EventQuery_}; #[derive(uniffi::Object)] pub struct EventQuery { @@ -16,22 +16,20 @@ impl EventQuery { event_filter: Option, ) -> EventQuery { EventQuery { - query: EventQuery_{ + query: EventQuery_ { address: Address::from(address.as_str()), from_block: from_block.map(Block::from), to_block: to_block.map(Block::from), event_signature, event_filter, - } + }, } } } impl From for EventQuery { fn from(query: EventQuery_) -> Self { - EventQuery { - query - } + EventQuery { query } } } @@ -44,7 +42,11 @@ pub struct EventLog { impl From for EventLog { fn from(log: EventLog_) -> Self { EventLog { - topics: log.topics.into_iter().map(|topic| topic.0.to_vec()).collect(), + topics: log + .topics + .into_iter() + .map(|topic| topic.0.to_vec()) + .collect(), data: log.data, } } @@ -55,4 +57,3 @@ impl Into for EventLog { EventLog_::new(self.topics, self.data) } } - diff --git a/indy-besu/vdr/uniffi/src/ffi/mod.rs b/indy-besu/vdr/uniffi/src/ffi/mod.rs index 18ac4d847..c552bb075 100644 --- a/indy-besu/vdr/uniffi/src/ffi/mod.rs +++ b/indy-besu/vdr/uniffi/src/ffi/mod.rs @@ -1,13 +1,13 @@ pub mod client; pub mod contracts; pub mod error; +pub mod event_query; pub mod transaction; pub mod types; -pub mod event_query; pub use client::*; pub use contracts::*; pub use error::*; +pub use event_query::*; pub use transaction::*; pub use types::*; -pub use event_query::*; diff --git a/indy-besu/vdr/uniffi/src/ffi/transaction.rs b/indy-besu/vdr/uniffi/src/ffi/transaction.rs index b5715a8e0..e6c1d5dea 100644 --- a/indy-besu/vdr/uniffi/src/ffi/transaction.rs +++ b/indy-besu/vdr/uniffi/src/ffi/transaction.rs @@ -2,7 +2,9 @@ use crate::ffi::{ error::{VdrError, VdrResult}, types::{SignatureData, TransactionSignature, TransactionType}, }; -use indy2_vdr::{Address, Transaction as Transaction_}; +use indy2_vdr::{ + Address, Transaction as Transaction_, TransactionEndorsingData as TransactionEndorsingData_, +}; #[derive(uniffi::Object)] pub struct Transaction { @@ -18,7 +20,7 @@ impl Transaction { to: String, chain_id: u64, data: Vec, - nonce: Option>, + nonce: Option, signature: Option, ) -> Transaction { Transaction { @@ -45,8 +47,24 @@ impl Transaction { impl From for Transaction { fn from(transaction: Transaction_) -> Self { - Transaction { - transaction, - } + Transaction { transaction } + } +} + +#[derive(uniffi::Object)] +pub struct TransactionEndorsingData { + pub data: TransactionEndorsingData_, +} + +#[uniffi::export] +impl TransactionEndorsingData { + pub fn get_signing_bytes(&self) -> VdrResult> { + self.data.get_signing_bytes().map_err(VdrError::from) + } +} + +impl From for TransactionEndorsingData { + fn from(data: TransactionEndorsingData_) -> Self { + TransactionEndorsingData { data } } } diff --git a/indy-besu/vdr/wasm/src/contracts/did_ethr_registry.rs b/indy-besu/vdr/wasm/src/contracts/did_ethr_registry.rs index 615b28c42..fbe17d3ec 100644 --- a/indy-besu/vdr/wasm/src/contracts/did_ethr_registry.rs +++ b/indy-besu/vdr/wasm/src/contracts/did_ethr_registry.rs @@ -1,6 +1,6 @@ use indy2_vdr::{ did_ethr_registry, Address, Block, DelegateType, DidDocAttribute, DidResolutionOptions, - EventLog, Validity, DID, + EventLog, SignatureData, Validity, DID, }; use std::rc::Rc; use wasm_bindgen::prelude::*; @@ -9,7 +9,7 @@ use crate::{ client::LedgerClientWrapper, error::{JsResult, Result}, event_query::EventQueryWrapper, - transaction::TransactionWrapper, + transaction::{TransactionEndorsingDataWrapper, TransactionWrapper}, }; #[wasm_bindgen(js_name = EthrDidRegistry)] @@ -35,6 +35,45 @@ impl EthrDidRegistry { Ok(TransactionWrapper(Rc::new(transaction))) } + #[wasm_bindgen(js_name = buildDidChangeOwnerEndorsingData)] + pub async fn build_did_change_owner_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + new_owner: &str, + ) -> Result { + let did = DID::from(did); + let new_owner = Address::from(new_owner); + let data = + did_ethr_registry::build_did_change_owner_endorsing_data(&client.0, &did, &new_owner) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(data))) + } + + #[wasm_bindgen(js_name = buildDidChangeOwnerSignedTransaction)] + pub async fn build_did_change_owner_signed_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + new_owner: &str, + signature_data: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let new_owner = Address::from(new_owner); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = did_ethr_registry::build_did_change_owner_signed_transaction( + &client.0, + &sender, + &did, + &new_owner, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + #[wasm_bindgen(js_name = buildDidAddDelegateTransaction)] pub async fn build_did_add_delegate_transaction( client: &LedgerClientWrapper, @@ -42,20 +81,74 @@ impl EthrDidRegistry { did: &str, delegate_type: &str, delegate: &str, - validity: Option, + validity: u64, ) -> Result { let sender = Address::from(sender); let did = DID::from(did); let delegate_type = DelegateType::try_from(delegate_type).as_js()?; let delegate = Address::from(delegate); - let validity = validity.map(Validity::from); + let validity = Validity::from(validity); let transaction = did_ethr_registry::build_did_add_delegate_transaction( &client.0, &sender, &did, &delegate_type, &delegate, - validity, + &validity, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidAddDelegateEndorsingData)] + pub async fn build_did_add_delegate_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + delegate_type: &str, + delegate: &str, + validity: u64, + ) -> Result { + let did = DID::from(did); + let delegate_type = DelegateType::try_from(delegate_type).as_js()?; + let delegate = Address::from(delegate); + let validity = Validity::from(validity); + let transaction = did_ethr_registry::build_did_add_delegate_endorsing_data( + &client.0, + &did, + &delegate_type, + &delegate, + &validity, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidAddDelegateSignedTransaction)] + pub async fn build_did_add_delegate_signed_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + delegate_type: &str, + delegate: &str, + validity: u64, + signature_data: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let delegate_type = DelegateType::try_from(delegate_type).as_js()?; + let delegate = Address::from(delegate); + let validity = Validity::from(validity); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = did_ethr_registry::build_did_add_delegate_signed_transaction( + &client.0, + &sender, + &did, + &delegate_type, + &delegate, + &validity, + &signature_data, ) .await .as_js()?; @@ -86,24 +179,120 @@ impl EthrDidRegistry { Ok(TransactionWrapper(Rc::new(transaction))) } + #[wasm_bindgen(js_name = buildDidRevokeDelegateEndorsingData)] + pub async fn build_did_revoke_delegate_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + delegate_type: &str, + delegate: &str, + ) -> Result { + let did = DID::from(did); + let delegate_type = DelegateType::try_from(delegate_type).as_js()?; + let delegate = Address::from(delegate); + let transaction = did_ethr_registry::build_did_revoke_delegate_endorsing_data( + &client.0, + &did, + &delegate_type, + &delegate, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidRevokeDelegateSignedTransaction)] + pub async fn build_did_revoke_delegate_signed_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + delegate_type: &str, + delegate: &str, + signature_data: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let delegate_type = DelegateType::try_from(delegate_type).as_js()?; + let delegate = Address::from(delegate); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = did_ethr_registry::build_did_revoke_delegate_signed_transaction( + &client.0, + &sender, + &did, + &delegate_type, + &delegate, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + #[wasm_bindgen(js_name = buildDidSetAttributeTransaction)] pub async fn build_did_set_attribute_transaction( client: &LedgerClientWrapper, sender: &str, did: &str, attribute: JsValue, - validity: Option, + validity: u64, ) -> Result { let sender = Address::from(sender); let did = DID::from(did); let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; - let validity = validity.map(Validity::from); + let validity = Validity::from(validity); let transaction = did_ethr_registry::build_did_set_attribute_transaction( &client.0, &sender, &did, &did_attribute, - validity, + &validity, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidSetAttributeEndorsingData)] + pub async fn build_did_set_attribute_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + attribute: JsValue, + validity: u64, + ) -> Result { + let did = DID::from(did); + let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; + let validity = Validity::from(validity); + let transaction = did_ethr_registry::build_did_set_attribute_endorsing_data( + &client.0, + &did, + &did_attribute, + &validity, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidSetAttributeSignedTransaction)] + pub async fn build_did_set_attribute_signed_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + attribute: JsValue, + validity: u64, + signature_data: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; + let validity = Validity::from(validity); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = did_ethr_registry::build_did_set_attribute_signed_transaction( + &client.0, + &sender, + &did, + &did_attribute, + &validity, + &signature_data, ) .await .as_js()?; @@ -131,6 +320,48 @@ impl EthrDidRegistry { Ok(TransactionWrapper(Rc::new(transaction))) } + #[wasm_bindgen(js_name = buildDidRevokeAttributeEndorsingData)] + pub async fn build_did_revoke_attribute_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + attribute: JsValue, + ) -> Result { + let did = DID::from(did); + let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; + let transaction = did_ethr_registry::build_did_revoke_attribute_endorsing_data( + &client.0, + &did, + &did_attribute, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidRevokeAttributeSignedTransaction)] + pub async fn build_did_revoke_attribute_signed_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + attribute: JsValue, + signature_data: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = did_ethr_registry::build_did_revoke_attribute_signed_transaction( + &client.0, + &sender, + &did, + &did_attribute, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + #[wasm_bindgen(js_name = buildGetDidOwnerTransaction)] pub async fn build_get_did_owner_transaction( client: &LedgerClientWrapper, @@ -155,15 +386,16 @@ impl EthrDidRegistry { Ok(TransactionWrapper(Rc::new(transaction))) } - #[wasm_bindgen(js_name = buildGetDidNonceTransaction)] - pub async fn build_get_did_nonce_transaction( + #[wasm_bindgen(js_name = buildGetIdentityNonceTransaction)] + pub async fn build_get_identity_nonce_transaction( client: &LedgerClientWrapper, - did: &str, + identity: &str, ) -> Result { - let did = DID::from(did); - let transaction = did_ethr_registry::build_get_did_nonce_transaction(&client.0, &did) - .await - .as_js()?; + let identity = Address::from(identity); + let transaction = + did_ethr_registry::build_get_identity_nonce_transaction(&client.0, &identity) + .await + .as_js()?; Ok(TransactionWrapper(Rc::new(transaction))) } diff --git a/indy-besu/vdr/wasm/src/transaction.rs b/indy-besu/vdr/wasm/src/transaction.rs index bef27cfc9..853b04bec 100644 --- a/indy-besu/vdr/wasm/src/transaction.rs +++ b/indy-besu/vdr/wasm/src/transaction.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{SignatureData, Transaction}; +use indy2_vdr::{SignatureData, Transaction, TransactionEndorsingData}; use std::rc::Rc; use wasm_bindgen::prelude::*; @@ -26,3 +26,15 @@ impl TransactionWrapper { Ok(()) } } + +#[wasm_bindgen(js_name = TransactionEndorsingData)] +pub struct TransactionEndorsingDataWrapper(pub(crate) Rc); + +#[wasm_bindgen(js_class = TransactionEndorsingData)] +impl TransactionEndorsingDataWrapper { + #[wasm_bindgen(js_name = getSigningBytes)] + pub fn get_signing_bytes(&self) -> Result> { + let bytes = self.0.get_signing_bytes().unwrap(); + Ok(bytes) + } +}