체인의정석

컨트렉트 지갑 및 어셈블리어 참고 링크 (업데이트) 본문

블록체인/퍼블릭 블록체인

컨트렉트 지갑 및 어셈블리어 참고 링크 (업데이트)

체인의정석 2022. 9. 15. 18:11
728x90
반응형

https://jamesbachini.com/assembly-in-solidity/

 

3 Examples Of How To Use Assembly In Solidity

Ethereum developers can directly use assembly in Solidity to improve the performance of their code. When OpenSea released the Seaport upgrade it reported the

jamesbachini.com

seaport에서 사용되는 어셈블리어 참고링크

 

https://medium.com/upstate-interactive/a-simple-example-for-how-to-use-soliditys-inline-assembly-d4259efaa7e0

 

A simple example for how to use Solidity’s Inline Assembly

With Solidity being a relatively new language it has some limitations. To address this Solidity makes it possible to interweave your…

medium.com

 

애용중인 Gnosis Multisig Wallet 컨트렉트

https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWallet.sol

 

GitHub - gnosis/MultiSigWallet: Allows multiple parties to agree on transactions before execution.

Allows multiple parties to agree on transactions before execution. - GitHub - gnosis/MultiSigWallet: Allows multiple parties to agree on transactions before execution.

github.com

function external_call(address destination, uint value, uint dataLength, bytes data) 
 private 
 returns (bool) 
{
    bool result;
    assembly {
        let x := mload(0x40)   
        let d := add(data, 32) 
        result := call(
            sub(gas, 34710),             
            destination,
            value,
            d,
            dataLength,        
            x,
            0
        )
    }
    return result;
}

call opcode를 활용. 거기에 필요한 인자값을 지정해서 넣어줌

 

https://docs.soliditylang.org/en/v0.4.24/assembly.html#opcodes

 

Solidity Assembly — Solidity 0.4.24 documentation

For more fine-grained control especially in order to enhance the language by writing libraries, it is possible to interleave Solidity statements with inline assembly in a language close to the one of the virtual machine. Due to the fact that the EVM is a s

docs.soliditylang.org

 

https://docs.soliditylang.org/en/v0.8.17/yul.html?highlight=call(g%2C%20a%2C%20v%2C%20in%2C%20insize%2C%20out%2C%20outsize)#evm-dialect 

 

Yul — Solidity 0.8.17 documentation

Yul Yul (previously also called JULIA or IULIA) is an intermediate language that can be compiled to bytecode for different backends. Support for EVM 1.0, EVM 1.5 and Ewasm is planned, and it is designed to be a usable common denominator of all three platfo

docs.soliditylang.org

 

728x90
반응형
Comments