169 похожих чатов

Guys how i can call the following permit() function, what

parameters should i pass for v,r,s? Any help is appreciated!

function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual override {
require(block.timestamp <= deadline, "ERC20Permit: expired deadline");
bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));
bytes32 hash = _hashTypedDataV4(structHash);
address signer = ECDSA.recover(hash, v, r, s);
require(signer == owner, "ERC20Permit: invalid signature");
_approve(owner, spender, value);
}

11 ответов

14 просмотров
Crypto-Find ⚠️ ☢️ Автор вопроса

Also can this be exploited so random user approves the tokens for another user to spend and then transfer them to his account via the transferFrom() function?

Its the signature you are going to pass

(v,r,s) are ECDSA components (digital signature)

Crypto-Find ⚠️ ☢️ Автор вопроса

Can this be exploited so users gets approval for spend on random addresses and withdraw each others tokens via transferFrom() function, because they will now have the allowances reuqired?

Without the user signing the permit data using his wallet, no

Crypto Find ⚠️ ☢️
Can this be exploited so users gets approval for s...

There are many attack vectors one can use to trick victims. However, the function alone is safe

Crypto-Find ⚠️ ☢️ Автор вопроса
Grim (Travelling)
Without the user signing the permit data using his...

can they use the 0x0 address as owner so they 'mint' them tokens from the -x- address?

Crypto-Find ⚠️ ☢️ Автор вопроса

So what i understand from this so far is - anyone can request for approval to spend someone's tokens but they cannot access them until the requested party 'approve' their request. Am i getting this right?

Crypto Find ⚠️ ☢️
So what i understand from this so far is - anyone ...

Think of it as like a real life permit. User A writes the following into a paper "User B is granting access to User A for taking X amount from User B's wallet" This has no validity until User B signs the paper right? That's exactly how erc20permit works too.

Crypto-Find ⚠️ ☢️ Автор вопроса
Grim (Travelling)
Think of it as like a real life permit. User A wri...

Thanks, thats good clarification! So this cannot be abused as 'mint' fom 0x0 address and withdrawing ones tokens without interaction from the requested side, yes?

Crypto Find ⚠️ ☢️
Thanks, thats good clarification! So this cannot b...

Yep just like normal approve-transferFrom pattern, you can't take it without the requested party's consent (sign)

Похожие вопросы

Обсуждают сегодня

А как старый хаскел с новым стыковать ? потому как тут работает https://play.haskell.org/saved/C3xpMzcd, а вот тут https://stepik.org/lesson/7602/step/9?unit=1473 нет ошибка C...
Fedor
131
Ребят, что лучше для реверса: гидра или ида?
En Vind Av Sorg
26
Вопрос я правильно понимаю что в коде newtype ArrowMap k v = ArrowMap { getArrowMap :: k -> Maybe v } getArrowMap есть функция типа k -> Maybe v, если да, то не понимаю задач...
Fedor
64
Делаю велосипед логгер. К сообщению хочу прикрутить некоторую информацию, типа, кем отправлено, какой уровень, и всякое такое. И тут подумалось мне, почему бы не хранить весь...
Serjone
24
Как Вы считаете нормально ли в двадцатых годах 21 века в ВУЗах Российской Федерации обучать студентов работе с TASM? Не слишком ли это "архаично"? (Если оффтоп или флейм для э...
Spiker01
52
а не подскажете вот это скрин из какой IDE ?
Iluha Companets
14
Комрады, хотел уточнить. Проперть в OnDestroy юнита-хозяина по-прежнему доступна? И еще уточнение: finalization юнита наступает раньше или позже OnDestroy?
Ed Doc
48
Продолжая диалог про свифт в проде – сейчас возник вопрос в активном наборе бекендеров. В основном в нашей компании мы фанаты Java Spring и полностью ей довольны. Однако найм ...
Guseyn
27
Народ всем привет Подскажите, как включить самописные dll библиотеки в итоговую сборку Сейчас при запуске dev сервера локально формируется папка build, из которой запускается...
Андрей
4
Читаю сейчас [нет, уже больше не читаю!] курсовую о Булгакове, написанную, похоже, с помощью ChatGPT. Это удивительный психоделический опыт. Текст в основном написан в стиле б...
✨ Uni [🌊 В отпуске]
1
Карта сайта