MCPcopy Create free account
hub / github.com/QuipNetwork/cpp-sdk / getQuipWalletAddress

Method getQuipWalletAddress

src/quip_factory.cpp:206–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204 }
205
206 Address getQuipWalletAddress(const VaultId &vaultId, const Address &to) {
207 Address checksummed_to = quip::toChecksumAddress(to);
208 // Encode the function call using the ABI encoding script
209 nlohmann::json params = {checksummed_to, toHex(vaultId)};
210 std::string params_json = params.dump();
211 std::string data = abiEncode("quips", abi_json, params_json);
212
213 // Call the contract - eth_call expects [call_object, block]
214 nlohmann::json call_object = {{"to", contract_address_}, {"data", data}};
215 nlohmann::json params_call = {call_object, "latest"};
216
217 auto response = sendJsonRpc("eth_call", params_call);
218 std::string result = response["result"];
219
220 // Decode the result (remove 0x prefix and extract the address)
221 if (result.length() >= 66) { // 0x + 64 hex chars
222 std::string address_hex = "0x" + result.substr(result.length() - 40);
223 return address_hex;
224 }
225
226 return "0x0000000000000000000000000000000000000000";
227 }
228
229 Amount getCreationFee() {
230 // Call the contract's creationFee() getter

Callers

nothing calls this directly

Calls 3

toChecksumAddressFunction · 0.85
toHexFunction · 0.85
abiEncodeFunction · 0.85

Tested by

no test coverage detected