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

fix(protocol): assembly Error fix #15923

Closed
wants to merge 1 commit into from
Closed

Conversation

cryptoryda
Copy link
Contributor

Error:
Compiler run failed:
Error (4619): Function "mcopy" not found.
   --> contracts/automata-attestation/utils/BytesUtils.sol:273:13:
    |
273 |             mcopy(dest, src, len)
    |             ^^^^^

We can solve this using :

 function memcpy(uint256 dest, uint256 src, uint256 len) private pure {
        assembly {
            for {
                let i := 0
            } lt(i, len) {
                i := add(i, 32)
            } { 
                mstore(add(dest, i), mload(add(src, i)))
            }
        }
    }

This loop copies 32 bytes at a time until the specified length is reached. Note that this implementation assumes that the length is a multiple of 32.

@dantaik
Copy link
Contributor

dantaik commented Feb 19, 2024

I don't have to error. Are you using the right compiler version?

@cryptoryda
Copy link
Contributor Author

Yes the right complier version is being used

@adaki2004
Copy link
Contributor

Use --evm-version cancun

@adaki2004 adaki2004 closed this Feb 20, 2024
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.

3 participants