CryptoFly.us | CRYPTOCURRENCY BITCOIN SHIRTS CLOTHING APPAREL HATS

CRYPTO NEWS

Does ReentrancyGuard locks every addresses while a `nonReentrant` function is called?

I am looking to secure a function within a contract from reEntrancy attacks, by attaching the nonReentrant modifier to it.

function myFunction(...) public nonRentrant { // ... } 

My question is:

a) Does the lock status (_status) applies to all addresses potentially interacting with the contract? or

b) Does it only applies only to the address interacting with the nonReentrant function?

Basically, what happen if two addresses make a call to the nonReentrant function at the same time.

I understand that it brings the function to a “lock state”, by switching the _status variable via the modifier. But what happen if two addresses (= 2 users) interact with the function at the same time?

modifier nonReentrant() {     // On the first call to nonReentrant, _notEntered will be true     require(_status != _ENTERED, "ReentrancyGuard: reentrant call");      // Any calls to nonReentrant after this point will fail     _status = _ENTERED;      _;   // <== what happen here if the function get called by another address here while still executing      // By storing the original value once again, a refund is triggered (see     // https://eips.ethereum.org/EIPS/eip-2200)     _status = _NOT_ENTERED; } 

Let’s imagine 2 users, A and B.

user A calls myFunction()

1.1 ==> the function gets locked via the modifier

1.2 ==> the function starts execution (running the code within)

user B calls myFunction() (while the contract is still executing call made by user A)

Will user B be able to execute the function? Or does he has to wait for the call from user A to finish? (because _status = _ENTERED)? In the 2nd scenario, I would imagine that my contract should have to keep track of all the addresses currently executing call via a mapping, so my code should look like below:

mapping (address => bool) private _locks;  modifier nonReentrant { require(_locks[msg.sender] != true, "ReentrancyGuard: reentrant call");  _locks[msg.sender] = true;  _;  _locks[msg.sender] = false; }  function myFunction(...) public nonReentrant {    // ... } 

How to decrypt a file using RSA and just a public.pem file?

I have an encoded file and a public.pem file. Is it possible to decode the file using the public.pem file or do I have to start looking at private keys? I tried https://github.com/Ganapati/RsaCtfTool with no luck. The public key (pem) is as below —–BEGIN PUBLIC KEY—– MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjHDiqVkO1umD2/Tm20Wt LpyBXGoIk4Pczeqjwz7/kwYLnQI7VlAzgjC9jD1dX80Z+kLOr5wHIDdfNK55nC/q ux/g7xVt0YKMl5yzObHUgX0YUi//8k2a5YfidxWoX77B7GfuBKx0efEsM7p+7cYT z7OVKFdRIvKATMGsYlWOPT9b97OtTQjtZKyhAtL1PdbfqKCCxRzqvj1OthtHbB+b 4AJG4MI2IHJQ0LHyj83md3iIMQSMZxwe8JsWQs3jW7W1xRDWjDsKn1799kPTTgG3 GtVrO6J38HN5t5dk8ZNa7duh9phRyEBQbo2lH/tYqUBKeJ3v/dA0BhQVMdZe5m8R uQIDAQAB —–END PUBLIC::Listen

I have an encoded file and a public.pem file. Is it possible to decode the file using the public.pem file or do I have to start looking at private keys?

I tried https://github.com/Ganapati/RsaCtfTool with no luck. The public key (pem) is as below

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjHDiqVkO1umD2/Tm20Wt
LpyBXGoIk4Pczeqjwz7/kwYLnQI7VlAzgjC9jD1dX80Z+kLOr5wHIDdfNK55nC/q
ux/g7xVt0YKMl5yzObHUgX0YUi//8k2a5YfidxWoX77B7GfuBKx0efEsM7p+7cYT
z7OVKFdRIvKATMGsYlWOPT9b97OtTQjtZKyhAtL1PdbfqKCCxRzqvj1OthtHbB+b
4AJG4MI2IHJQ0LHyj83md3iIMQSMZxwe8JsWQs3jW7W1xRDWjDsKn1799kPTTgG3
GtVrO6J38HN5t5dk8ZNa7duh9phRyEBQbo2lH/tYqUBKeJ3v/dA0BhQVMdZe5m8R
uQIDAQAB
-----END PUBLIC KEY-----

Does ReentrancyGuard locks every addresses while a `nonReentrant` function is called?

Shopping cart
There are no products in the cart!
Continue shopping
0