Primrose Docs
  • Home
    • ⛓️Blockchain
      • Avalanche
        • What is AVAX?
      • Ethereum
        • Ethereum Cancun Upgrade Explained(draft)
        • go-ethereum: gas estimate
        • Blockchain Transaction Lifecycle
        • Mempool
        • Gas optimization in Solidity, Ethereum
      • Solidity DeepDive
        • Meta transaction
        • solidity: patterns
        • UUPS vs Transparent
        • Solidity Interface
        • Smart contract storage
        • ERC-2981 Contract
        • Solidity modifier
        • Solidity delete keyword
        • How To Make NFTs with On-Chain Metadata - Hardhat and JavaScript
        • How to Build "Buy Me a Coffee" DeFi dapp
        • How to Develop an NFT Smart Contract (ERC 721) with Alchemy
        • Upgradeable Contract
        • Smart Contract Verification
      • Common
        • Eigenlayer
        • MultiSig(draft)
        • Chain-Based Proof-of- Stake, BFT-Style Proof-of-Stake
        • Byzantine Fault Tolerance
        • Zero-knowledge
        • Hierarchical Deterministic Wallet
        • Maker DAO
        • Defi
        • Uniswap
        • IBC
        • Cosmos
        • Gossip Protocol
        • Tendermint
        • UTXO vs Account
        • Blockchain Layer
        • Consensus Algorithm
        • How does mining work?
        • Immutable Ledger
        • SHA256 Hash
        • Filecoin
        • IPFS - InterPlanetary File System
        • IPFS와 파일코인
        • Livepeer
        • Layer 0
      • Bitcoin
        • BIP for HD Wallet
        • P2WPKH
        • Segwit vs Native Segwit
    • 📖Languages
      • Javascript/Typescript
        • Hoisting
        • This value in Javascript
        • Execution Context
        • About Javscript
        • tsconfig.json
        • Nest js Provider
        • 'return await promise' vs 'return promise'
      • Python
        • Pythonic
        • Python: Iterable, Iterator
        • Uvicorn & Gunicorn
        • WSGI, ASGI
        • Python docstring
        • Decorator in Python
        • Namespace in Python
        • Python Method
      • Go
        • GORM+MySQL Connection Pool
        • Context in golang
        • How to sign Ethereum EIP-1559 transactions using AWS KMS
        • Mongo DB in golang(draft)
        • Golang HTTP Package
        • Panic
        • Golang new/make
        • golang container package
        • errgroup in golang
        • Generic Programming in Golang
        • Goroutine(draft)
    • 📝Database
      • MongoDB in golang
      • Nested loop join, Hash join
      • DB Query plan
      • Index
      • Optimistic Lock Pessimistic Lock
    • 💻Computer Science
      • N+1 query in go
      • Web server 를 구성할 때 Thread, Process 개수를 어떻게 정할 것인가?
      • CAP
      • Socket programming
      • DNS, IP
      • URL, URI
      • TLS과 SSL
      • Caching(draft)
      • Building Microservices: Micro Service 5 Deploy Principle
      • Red Black Tree
      • AOP
      • Distributed Lock
      • VPC
      • Docker
      • All about Session and JWT
      • Closure
      • Singleton Pattern
      • TCP 3 way handshake & 4 way handshake
      • Race Condition
      • Process Address Space 
      • Call by value, Call by reference, Call by assignment
      • Zookeeper, ETCD
      • URL Shortening
      • Raft consensus
      • Sharding, Partitioning
    • 📒ETC
      • K8S SIGTERM
      • SQS
      • Git Branch Strategy: Ship / Show / Ask
      • Kafka
      • Redis Data Types
      • CI/CD
      • How does Google design APIs?
      • Minishell (42 cursus)
      • Coroutine & Subroutine
      • Redis
Powered by GitBook
On this page
  • Upgradeable Contract
  • UUPS (Universal Upgradeable Proxy Standard)
  • Transparent (Openzeppelin)
  1. Home
  2. Blockchain
  3. Solidity DeepDive

UUPS vs Transparent

Upgradeable Contract

업그레이드 가능한 스마트 컨트랙트는 보통 proxy pattern을 사용해서 배포된다.

한 번 배포된 스마트 컨트랙트의 코드를 변경할 수 없기 때문에, 저장을 담당하는 Storage Contract와 실제 비즈니스 로직을 포함하는 Logic Contract로 분할하여 작동한다.

자세한 내용은 이전에 작성한 글을 참고하면 좋을 것 같다.

아무튼 요약 정리하면 다음과 같다.

  • Upgradeable contract는 코드를 추론하기 어렵게 만들고, 버그의 위험이 증가되므로 충분한 테스트와 Audit process가 이루어져야 한다.

  • Contract를 업그레이드 할 수 있으므로 업그레이드를 수행할 권한이 있는 관리자 계정이 있어야한다. (역으로 말하자면 관리자 계정으로 중앙 집중화가 된다).

  • 자료구조의 레이아웃이 변경되어서는 안된다.

UUPS (Universal Upgradeable Proxy Standard)

EIP-1822에 해당하는 이 표준은 간단하고 효율적으로 업그레이드를 할 수 있도록 해준다.

이 패턴에선 구현 관리 및 fallback 기능을 포함한 모든 작업이 한 컨트랙트에 포함되어 있다.

UUPS 패턴에서는 업그레이드 기능을 호출할 수 있는 사람을 제한하기 위해 modifier를 사용하여 업그레이드 기능을 보호할 수 있다.

또한 UUPS 패턴은 단순성 때문에 더 가스 효율적이다.

Transparent (Openzeppelin)

Transparent 에서는 Proxy Contract와 Implementation Contract로 나뉜다.

당연히 배포비용이 많이 들지만, 유지 관리가 쉽다.

오픈제플린에서는 UUPS를 권장한다. 말 듣는게 좋을 것 같다.

Previoussolidity: patternsNextSolidity Interface

Last updated 1 year ago

⛓️