Skip to content

ERC-20: change admin address#184

Merged
birchmd merged 4 commits into
developfrom
erc20-admin
Aug 26, 2021
Merged

ERC-20: change admin address#184
birchmd merged 4 commits into
developfrom
erc20-admin

Conversation

@sept-en
Copy link
Copy Markdown
Contributor

@sept-en sept-en commented Jul 16, 2021

Fixes #175

@sept-en sept-en added the C-enhancement Category: New feature or request label Jul 16, 2021
@sept-en sept-en changed the base branch from master to develop July 16, 2021 11:36
@joshuajbouw joshuajbouw force-pushed the develop branch 2 times, most recently from 216e375 to 9d09598 Compare August 13, 2021 16:25
@birchmd birchmd marked this pull request as ready for review August 23, 2021 16:58
Copy link
Copy Markdown
Contributor Author

@sept-en sept-en left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @birchmd !

@joshuajbouw please review

Comment thread src/engine.rs
Comment on lines +802 to +832
match submit_result.status {
TransactionStatus::Succeed(_) => Ok(()),
TransactionStatus::Revert(bytes) => {
let error_message = crate::prelude::format!(
"Reverted with message: {}",
String::from_utf8_lossy(&bytes)
);
Err(EngineError {
kind: EngineErrorKind::EvmError(ExitError::Other(Cow::from(
error_message,
))),
gas_used: submit_result.gas_used,
})
}
TransactionStatus::OutOfFund => Err(EngineError {
kind: EngineErrorKind::EvmError(ExitError::OutOfFund),
gas_used: submit_result.gas_used,
}),
TransactionStatus::OutOfOffset => Err(EngineError {
kind: EngineErrorKind::EvmError(ExitError::OutOfOffset),
gas_used: submit_result.gas_used,
}),
TransactionStatus::OutOfGas => Err(EngineError {
kind: EngineErrorKind::EvmError(ExitError::OutOfGas),
gas_used: submit_result.gas_used,
}),
TransactionStatus::CallTooDeep => Err(EngineError {
kind: EngineErrorKind::EvmError(ExitError::CallTooDeep),
gas_used: submit_result.gas_used,
}),
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing that I can comment on is that this feels weird to me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for this mapping is to turn any failed status into a proper error, which will cause the NEAR transaction to fail. The reason we want to fail the NEAR transaction in this case, but not in the case of submit calls is because this is internal to Aurora. There is no nonce that needs to be incremented or EVM gas that needs to be charged, so we do not need to worry about state being reverted because the transaction fails.

It should also be true that in production none of these failure statuses ever come up (again because its an internal call). But I thought it was still better to catch and properly report them rather than silently swallowing failures, just to be safe.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No no I get the logic behind it. It just feels like we need a From<T> type of implementation given its structure but that isn't exactly possible.

@mrLSD mrLSD self-requested a review August 26, 2021 11:05
@birchmd birchmd merged commit bab5d2d into develop Aug 26, 2021
@birchmd birchmd deleted the erc20-admin branch August 26, 2021 12:17
artob added a commit that referenced this pull request Sep 13, 2021
* ERC-20: change admin address (#184)
* Fix promise, broken in upstream (#227)
* Feat(tests): View call profiling (#250)
* Fix evm_bully feature enabling in Makefile (#252)
* Feat(benches): Profile NFT paginated view call (#253)
* Update CODEOWNERS (#255)
* Bump @openzeppelin/contracts from 4.1.0 to 4.3.1 in /etc/eth-contracts (#254)
* Bump tar from 4.4.15 to 4.4.19 in /etc/eth-contracts (#257)
* Upgrade nearcore dependencies to latest commit (#259)
* 1inch deploy benchmark (#261)

Co-authored-by: Dmitry Strokov <dmitry@aurora.dev>
Co-authored-by: Joshua J. Bouw <joshua@aurora.dev>
Co-authored-by: Kirill <kirill@aurora.dev>
Co-authored-by: Michael Birch <michael@aurora.dev>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category: New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update ERC-20 tokens metadata from the dedicated account

4 participants