Gas optimization in Solidity, Ethereum
I’m sorry but my English is terrible. I hope you understand that generously.Recently, I was developing a toy project named Blind Market. It’s a simple P2P trading application using smart contract. I was making a contract using Solidity, and the trade stage proceeded in the order of pending, shipping, and done. The problem was appeared in done phase. The problem was that when I tried to close the transaction by paying the price raised by the seller in msg.value, the following error occurred.Pe...
Uvicorn & Gunicorn
Uvicorn and GunicornUvicorn and Gunicorn are important concepts when developing applications in Python. However, there are many concepts to be aware of in order to fully understand Uvicorn and Gunicorn. The following is a brief summary of the necessary concepts, and the details will be dealt with separately later.Necessary ConceptsStarletteStarlette is a Web application server that can run asynchronously. Starlette runs on top of Uvicorn.FastAPIFastAPI provides many features on top of Starlet...
P2WPKH
P2WPKHP2WPKH란 비트코인 내에서 가장 일반적인 스크립트 형식으로 비트코인 프로토콜에 대한 지불 거래 유형이다. 주소는 1로 시작하는데, 세그윗을 지원하는 새로운 주소 3 또는 bc1로 시작하는 주소보다 훨씬 비싸다. https://mirror.xyz/0xA1d9f681B25C14C1eE7B87f1CF102E73cA3ad4d9/egjhNVklgy_LgZmcTXXAOTBa6ePBqO3Ja9ZSoDIad-8 즉, 비트코인 주소가 1로 시작하면 P2PKH 주소를 사용하고 있는 것이다. 공개키의 간단한 해시이며, 이 해시를 주소로 사용하는 것이다. 이것은 원래 비트코인 주소 형식이었으며 오늘까지도 충실히 작동한다. 레거시 주소는 세그윗과 호환되지 않지만, 여전히 문제없이 P2PKH 주소에서 세그윗 주소로 BTC를 보낼 수 있다. 그러나 레거시 주소 트랜잭션이 더 크기 때문에 P2PKH 주소에서 전송하는 평균 속도는 세그윗 주소에서 전송할 때보다 더 높은 요금이 발생할 수 있다....
Smart Contract Developer, Web3 Backend Developer
Gas optimization in Solidity, Ethereum
I’m sorry but my English is terrible. I hope you understand that generously.Recently, I was developing a toy project named Blind Market. It’s a simple P2P trading application using smart contract. I was making a contract using Solidity, and the trade stage proceeded in the order of pending, shipping, and done. The problem was appeared in done phase. The problem was that when I tried to close the transaction by paying the price raised by the seller in msg.value, the following error occurred.Pe...
Uvicorn & Gunicorn
Uvicorn and GunicornUvicorn and Gunicorn are important concepts when developing applications in Python. However, there are many concepts to be aware of in order to fully understand Uvicorn and Gunicorn. The following is a brief summary of the necessary concepts, and the details will be dealt with separately later.Necessary ConceptsStarletteStarlette is a Web application server that can run asynchronously. Starlette runs on top of Uvicorn.FastAPIFastAPI provides many features on top of Starlet...
P2WPKH
P2WPKHP2WPKH란 비트코인 내에서 가장 일반적인 스크립트 형식으로 비트코인 프로토콜에 대한 지불 거래 유형이다. 주소는 1로 시작하는데, 세그윗을 지원하는 새로운 주소 3 또는 bc1로 시작하는 주소보다 훨씬 비싸다. https://mirror.xyz/0xA1d9f681B25C14C1eE7B87f1CF102E73cA3ad4d9/egjhNVklgy_LgZmcTXXAOTBa6ePBqO3Ja9ZSoDIad-8 즉, 비트코인 주소가 1로 시작하면 P2PKH 주소를 사용하고 있는 것이다. 공개키의 간단한 해시이며, 이 해시를 주소로 사용하는 것이다. 이것은 원래 비트코인 주소 형식이었으며 오늘까지도 충실히 작동한다. 레거시 주소는 세그윗과 호환되지 않지만, 여전히 문제없이 P2PKH 주소에서 세그윗 주소로 BTC를 보낼 수 있다. 그러나 레거시 주소 트랜잭션이 더 크기 때문에 P2PKH 주소에서 전송하는 평균 속도는 세그윗 주소에서 전송할 때보다 더 높은 요금이 발생할 수 있다....
Share Dialog
Share Dialog
Smart Contract Developer, Web3 Backend Developer

Subscribe to Primrose

Subscribe to Primrose
업그레이드 가능한 스마트 컨트랙트는 보통 proxy pattern을 사용해서 배포된다.
한 번 배포된 스마트 컨트랙트의 코드를 변경할 수 없기 때문에, 저장을 담당하는 Storage Contract와 실제 비즈니스 로직을 포함하는 Logic Contract로 분할하여 작동한다.
자세한 내용은 이전에 작성한 글을 참고하면 좋을 것 같다.
아무튼 요약 정리하면 다음과 같다.
Upgradeable contract는 코드를 추론하기 어렵게 만들고, 버그의 위험이 증가되므로 충분한 테스트와 Audit process가 이루어져야 한다.
Contract를 업그레이드 할 수 있으므로 업그레이드를 수행할 권한이 있는 관리자 계정이 있어야한다. (역으로 말하자면 관리자 계정으로 중앙 집중화가 된다).
자료구조의 레이아웃이 변경되어서는 안된다.
EIP-1822에 해당하는 이 표준은 간단하고 효율적으로 업그레이드를 할 수 있도록 해준다.
https://eips.ethereum.org/EIPS/eip-1822
이 패턴에선 구현 관리 및 fallback 기능을 포함한 모든 작업이 한 컨트랙트에 포함되어 있다.
UUPS 패턴에서는 업그레이드 기능을 호출할 수 있는 사람을 제한하기 위해 modifier를 사용하여 업그레이드 기능을 보호할 수 있다.
또한 UUPS 패턴은 단순성 때문에 더 가스 효율적이다.
Transparent 에서는 Proxy Contract와 Implementation Contract로 나뉜다.
당연히 배포비용이 많이 들지만, 유지 관리가 쉽다.
오픈제플린에서는 UUPS를 권장한다. 말 듣는게 좋을 것 같다.
업그레이드 가능한 스마트 컨트랙트는 보통 proxy pattern을 사용해서 배포된다.
한 번 배포된 스마트 컨트랙트의 코드를 변경할 수 없기 때문에, 저장을 담당하는 Storage Contract와 실제 비즈니스 로직을 포함하는 Logic Contract로 분할하여 작동한다.
자세한 내용은 이전에 작성한 글을 참고하면 좋을 것 같다.
아무튼 요약 정리하면 다음과 같다.
Upgradeable contract는 코드를 추론하기 어렵게 만들고, 버그의 위험이 증가되므로 충분한 테스트와 Audit process가 이루어져야 한다.
Contract를 업그레이드 할 수 있으므로 업그레이드를 수행할 권한이 있는 관리자 계정이 있어야한다. (역으로 말하자면 관리자 계정으로 중앙 집중화가 된다).
자료구조의 레이아웃이 변경되어서는 안된다.
EIP-1822에 해당하는 이 표준은 간단하고 효율적으로 업그레이드를 할 수 있도록 해준다.
https://eips.ethereum.org/EIPS/eip-1822
이 패턴에선 구현 관리 및 fallback 기능을 포함한 모든 작업이 한 컨트랙트에 포함되어 있다.
UUPS 패턴에서는 업그레이드 기능을 호출할 수 있는 사람을 제한하기 위해 modifier를 사용하여 업그레이드 기능을 보호할 수 있다.
또한 UUPS 패턴은 단순성 때문에 더 가스 효율적이다.
Transparent 에서는 Proxy Contract와 Implementation Contract로 나뉜다.
당연히 배포비용이 많이 들지만, 유지 관리가 쉽다.
오픈제플린에서는 UUPS를 권장한다. 말 듣는게 좋을 것 같다.
<100 subscribers
<100 subscribers
No activity yet