You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should provide access to account mappings within Solidity contracts so devs can verify signed messages. Currently the address returned by ecrecover in a Solidity contract can't be matched to any DAppChain account (nor msg.sender).
It would look something like this:
// get the address matching the secp256k1 private key that signed the messageaddress signer =ecrecover(_message, _v, _r, _s);
// get the DAppChain address of the signeraddress account = loom_native_api.mappedAccount('eth', signer);
This would need to be implemented as a precompiled EVM contract, we've got an example of doing so in
Going the other way (DAppChain address -> Eth address) would also be useful:
// lookup the mapping of the DAppChain address of msg.sender to an Eth addressaddress ethAccount = loom_native_api.mappedAccount('loom', msg.sender, 'eth')
address signer =ecrecover(_message, _v, _r, _s);
// can now compare ethAccount to signer to verify msg.sender signed the message
We should provide access to account mappings within Solidity contracts so devs can verify signed messages. Currently the address returned by
ecrecover
in a Solidity contract can't be matched to any DAppChain account (normsg.sender
).It would look something like this:
This would need to be implemented as a precompiled EVM contract, we've got an example of doing so in
loomchain/evm/evm_test.go
Line 71 in 1521b61
ecrecover
and friends https://github.com/ethereum/go-ethereum/blob/master/core/vm/contracts.goThe text was updated successfully, but these errors were encountered: