Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn user at deploy time if contract size above ethereum/EIPs#170 #1461

Merged
merged 1 commit into from
Aug 20, 2018

Conversation

bakaoh
Copy link
Contributor

@bakaoh bakaoh commented Aug 15, 2018

Fix: #1457

}

if (selectedContract.contract.object.evm.deployedBytecode.object.length > 24576) {
modalDialog('Contract code size over limit', yo`<div>Contract creation initialization returns data with length of more than 24576 bytes. The deployment will likely fails.</div>`,
Copy link
Collaborator

@yann300 yann300 Aug 15, 2018

Choose a reason for hiding this comment

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

could we add a link to the iep too? (as reference to user know what is this limitation for)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yann300 -- i've added it ^^

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks but i meant as a link in the content of the modal too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's done ^^

@bakaoh bakaoh force-pushed the issue1457 branch 2 times, most recently from 0b2a49b to 694e311 Compare August 15, 2018 09:15
@bakaoh
Copy link
Contributor Author

bakaoh commented Aug 16, 2018

@yann300 --- anything else i need to do?

})
}

if (selectedContract.contract.object.evm.deployedBytecode.object.length > 24576) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

object here is hex string.
1 hex string is 1/2 bytes.
so you need to divide by 2 here to get the length in bytes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yann300 - thanks, i fixed it

@yann300 yann300 merged commit 446cfb6 into ethereum:master Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants