I'm trying to implement openzeppelin's minimal proxy clone contract on TRON blockchain

The openzeppelin minimal proxy contract here has this function predictDeterministicAddress() that hashes values like the sender's address, a salt... to generate a contract address that the create2 function will also generate, when its passed the same values as dictated in this EIP.


This EIP states that an arbitrary value 0xff when hashed with a salt, senders address and the contract bytecode will always generate the same address.

Im trying to implement the predictDeterministicAddress() function on TRON blockchain but the TRON docs specify a different arbitrary value, 0x41 for implementing this same feature.

I tried to just replace the values but i can't see where the openzeppelin team used the value 0xff in their function.


Below is the openzeppelin hashing function:

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(
        address implementation,
        bytes32 salt,
        address deployer
    ) internal pure returns (address predicted) {
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)
            mstore(add(ptr, 0x38), shl(0x60, deployer))
            mstore(add(ptr, 0x4c), salt)
            mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))
            predicted := keccak256(add(ptr, 0x37), 0x55)
        }
    }

Also due to my limited knowledge of assembly i cant fully grasp how their hashing function works exactly.


Can anyone explain to me, or help me understand how that function can be implemented on the TRON blockchain to the desired effect?


Basically i want to be able to pass the same values to create2 and also to this function on the TRON blockchain, and generate the same contract address.

Hello viewer, so i was able to get an answer on stackoverflow. Here is a link to it, if interested. https://stackoverflow.com/questions/71573083/im-trying-to-implement-openzeppelins-minimal-proxy-clone-contract-on-tron-bloc/71581522#71581522