일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 체인의정석
- 스마트 컨트렉트 함수이름 중복
- rust 기초
- 스마트컨트렉트 함수이름 중복 호출
- erc4337
- 머신러닝기초
- 컨트렉트 배포 자동화
- 러스트 기초
- erc4337 contract
- ethers v6
- ethers type
- 티스토리챌린지
- multicall
- chainlink 설명
- 오블완
- 스마트컨트렉트 예약어 함수이름 중복
- SBT표준
- ethers
- 계정추상화
- ethers typescript
- 스마트컨트렉트테스트
- 컨트렉트 동일한 함수이름 호출
- ethers websocket
- vue기초
- ambiguous function description
- 러스트기초
- 러스트 기초 학습
- git rebase
- Vue.js
- Vue
Archives
- Today
- Total
체인의정석
create2 & create3에서의 Owner msg.sender 처리 본문
728x90
반응형
`msg.sender` isn't the initiator in a contract that's created by another contract
The situation you've described is a common challenge when using factory or deployer contracts in combination with other contracts that rely on msg.sender for initial setup, especially when the desired behavior is to assign ownership or mint tokens to the o
forum.openzeppelin.com
상황 : create3에서 배포한 함수의 owner 가 msg.sender가 아님
1. 일반적인 인터널 tx가 아닌 create함수를 사용하는 경우 msg.sender가 배포한 컨트렉트 주소가 됨
2. tx.origin을 써서 고칠수도 있지만 해당 부분은 모호하기에 보안적으로 안좋을 수 있다.
3. constructor에서 명시적으로 owner를 받아오는것이 중요
=> create3에서 owner를 생성자에서 받아오도록 설정
728x90
반응형
'블록체인 > Solidity' 카테고리의 다른 글
Lens, Gateway 등 조회 컨트렉트를 만들 때의 유의점 (0) | 2024.04.26 |
---|---|
ERC721,1155 receiver (0) | 2024.04.05 |
Solidity에서 bytes, bytes32 console.log로 찍는법 (0) | 2024.02.26 |
solidity error : reverted with panic code 0x32, 동적 배열 사용시 발생하는에러 (0) | 2024.01.12 |
SyntaxError: Identifier expected. 'const' is a reserved word that cannot be used here. 에러 해결 (1) | 2024.01.08 |
Comments